Coder Social home page Coder Social logo

reduce-algebra / mtt Goto Github PK

View Code? Open in Web Editor NEW
4.0 6.0 0.0 13.32 MB

mtt: Model Transformation Tools, Bond-graph based modeling tools: 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.

Home Page: https://github.com/reduce-algebra/mtt

License: GNU General Public License v2.0

mtt reduce octave gnu model-transformations bond-graphs dynamic-model

mtt's Introduction

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.
  • MTT is mainly built on the GNU set of tools.
  • MTT uses the algebraic package REDUCE.
  • MTT is based on the bond graph language; general bond graph information is available from The Bond Graph Compendium homepage.

Availability


License

  • GNU General Public License, Version 2, June 1991 (GPLv2)

Issue Tracking


Authors


mtt's People

Contributors

deepsource-autofix[bot] avatar deepsourcebot avatar johnsonjh avatar restyled-commits avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mtt's Issues

(SH-2129) Consider grouping multiple command redirects

Description

Rather than adding &gt;&gt; something after every single line, you can simply group the relevant commands and redirect the group. Now the file has to be opened and closed only once, which can be a performance gain. <!--more--> ## Examples ### Bad Practice ```sh echo foo >> file date >> …

Occurrences

There are 2 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2129/occurrences/

Dia bond graph design interface


It would be nice to be able to draw hierarchical bond graphs using the Dia diagram editor. This will provide
the following advantages:

  • When ports are moved, bonds and bond labels will follow automatically. Bonds will never collide with
    components.
  • Will be possible to construct hierarchical bond graphs using either .fig or .dia diagrams.
  • Bond connectivity, causality, and labels will be structural properties, stored as XML in the dia file. Unconnected bonds will appear differently from connected bonds. Will not be necessary to check
    connectivity using a stripped acausal bond graph because there will be no ambiguity in the bond graph
    representation.

Modifications to Dia have been written which interact with mtt for non-hierarchical bond graphs. This works just fine. In the mtt list, Geraint presents some ideas about how to do hierarchical bond graphs with
Dia. It would be nice for us to pursue these ideas.

I am writing this 'feature request' to:

  • Get this project rolling again after several hectic months during which I quit working on this project.
  • Indicate to prospective contributors that they can contact me at my sourceforge e-mail address if they
    wish to have the modified dia code for mtt/dia development.

David Hoover.


Reply from Geraint Paul Bevan - 2004-07-23:

Logged In: YES
user_id=71249

Hi Dave,

I think I finally have -ibg working for hierarchical bond graphs (it took a long time, sorry). The (*_abg.m) files produced with or without using -ibg are now identical so everything should(!) work for hierarchical bond graphs built with Dia (or even Dia/Xfig hybrids, I think). At least, it should all be ready for testing and fixing.

The changes that you made to Dia don't seem to have made it into the Debian build (v0.93). Are the latest changes available in the Dia CVS repository or does the code need to be patched?

The latest patches that I am aware of are those at http://mail.gnome.org/archives/dia-list/2002-November/msg00109.html

If you sent me any more recent ones, I'm afraid I will have lost them - I've had a couple of hard drive failures and the Sourceforge lists don't seem to keep attachments.

I tried building Dia from CVS last night (without applying any patches) but without success - I'll try again in a few days.

Geraint.


(SH-2046) Consider quoting command expansion to prevent word splitting

Description

When command expansions are unquoted, word splitting and globbing will occur. This can result unintended behaviour filenames contain spaces. Trying to fix it by adding quotes or escapes to the data will not work. Instead, quote the command substitution itself. If the command substitution outputs multiple pieces of data, it …

Occurrences

There are 2 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2046/occurrences/

New DIY rep structure


As discussed, we need a new DIY rep.

Here is what I propose:

Implementation:

I think I made the wrong decision to confine the DIY rep implementation to a Makefile. I think we should use shell-scripts as for the built-ins. These could, of course, include a Makefile (as does MTT). However, I do think it best to include all the languages in the one script, and the script always returns 2 (or some other non-zero error) if it does not implement a particular language.

Interface:

We extend mtt to include representation-specific options:

  • mtt [mtt-options] sys [rep-options] newrep lang

mtt then tries to run:

  • mtt_rep_newrep [rep-options] lang

...if the rep does not exist, mtt proper is invoked (as at present). But this also happens if mtt_rep_newrep returns 2 as above.

I think this overcomes the problem you mention in the previous mail. That is, newrep can extend (or indeed replace) built-in representations to include new languages.

All DIY reps can be interrogated by mtt e.g.:

  • mtt_rep_newrep --help writes helpful text to standard output
  • mtt_rep_newrep --usage writes usage info to standard output
  • mtt_rep_newrep --texi wites texinfo documentation to standard output

This provides the basis for a comprehensive help facility in mtt.

I like the idea of a single file for all of this; thus the script would contain other files and write them as
necessary.


Partitioning


Automatic system partitioning still not implemented.

Ideally, should work right though to code.


Reply from Peter Gawthrop - 2002-04-25:

  • labels: --> Core mtt
  • assigned_to: nobody --> gawthrop

additional \usepackage directives


The ability to specify additional TeX packages to use when creating model reports would be useful. For example, the "listings" package may be required to format and display C++ CRs or "textcomp" to include various symbols. Ideally, the user should be able to specify additional packages without editing the default mtt.sty.

This could probably be achieved by having mtt.sty include <modelname>.sty, if it exists, from the working directory and including it before the document begins. This would also have the benefit of providing the user with the ability to specify \newcommands. Alternatively, site specific .sty files could be
specified in mttrc.


Reply from Geraint Paul Bevan - 2002-10-29:

  • priority: 5 --> 1
  • assigned_to: gawthrop ⟶ nobody

Spurious ":" cause bizarre behavior

  • Transferred from https://sourceforge.net/p/mtt/bugs/15/
    • Status: open
    • Owner: Peter Gawthrop
    • Labels: MTT (33)
    • Priority: 7
    • Updated: 2002-04-25
    • Created: 2002-04-25
    • Creator: Peter Gawthrop
    • Private: No

Spurious : in lbl.txt and other .txt files ate not caught by mtt and cause odd behavior.

Flag error if such things are observed.

Maybe a generic filter is needed here and invoked when
input.txt etc is checked and when _lbl.txt is first used.


(SH-2006) Use of legacy backtick

Description

Consider using the $(...) notation instead. Backtick command substitution \...`is legacy syntax with several issues. * It has a series of undefined behaviors related to quoting in POSIX. * It imposes a custom escaping mode with surprising results. * It&#x27;s exceptionally hard to nest.$(...)` command substitution has none …

Occurrences

There are 45 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2006/occurrences/

Local numpar files and variables


#local par makes par a local variable

it is refered to globally by full_system_name_par

Need to defualt top-level numpar file with values from lower level.


Reply from Peter Gawthrop - 2002-11-07:

Logged In: YES
user_id=76190

Maybe include files (like c header files) could be one way forward here.
This would be supported in all the .txt files ....


Coincident components & bonds

  • Transferred from https://sourceforge.net/p/mtt/bugs/17/
    • Milestone: Bug
    • Status: open
    • Owner: Peter Gawthrop
    • Labels: MTT (33)
    • Priority: 1
    • Updated: 2002-04-25
    • Created: 2002-04-25
    • Creator: Peter Gawthrop
    • Private: No

The user cannot see coincident components & bonds in the abg.fig rep.
Yet this caused bizarre errors.

mtt should remove such things and report.

(Components are easy, just check for repeated lines in the file)


Aliasing vector ports


At the moment...

#ALIAS xy x,y

only works if x and y are scalar ports.

Extend to case where x and/or y are scalar.


modpar.r generation is broken

  • Transferred from https://sourceforge.net/p/mtt/bugs/25/
    • Milestone: Bug
    • Status: open
    • Owner: nobody
    • Labels: MTT (33)
    • Priority: 5
    • Updated: 2002-05-17
    • Created: 2002-05-17
    • Creator: Geraint Paul Bevan
    • Private: No

The recent update (2002/04/16) of modpar_txt2r has broken the generation of <sys>_modpar.r.

It appears that modpar_txt2r now expects modulated parmameters to be prepended by the name of the system, which differs from previous behavior.

log session below illustrates problem:

$ mtt -q RC modpar txt
Copying RC_modpar.txt
$
$ cat RC_modpar.txt
# Modpar file (RC_modpar.txt)
# Generated by MTT at Fri May 17 12:11:51 BST 2002
variable

# End of RC_modpar.txt
$
$ mtt -q RC struc txt
Copying RC_struc.txt
$
$ cat RC_struc.txt
input
1
control
RC_control
1
input
2
variable
RC_variable
1
output
1
control
RC_control
1
state
1
c
RC_c
1
$
$ modpar_txt2r RC
Creating RC_modpar.r
$
$ cat RC_modpar.r
% Modpar file (RC_modpar.r)
% Generated by MTT at Fri May 17 12:16:43 BST 2002
$
$ cat ../../previous/RC/MTT_work/RC_modpar.r
% Modpar file (RC_modpar.r)
% Generated by MTT at Mon May 13 18:45:54 BST 2002
variable := mttu(2,1);
$ 

(SH-2003) Outdated `expr` statement

Description

According to POSIX: > The expr utility has a rather difficult syntax [...] In many cases, the arithmetic and string features provided as part of the shell command language are easier to use than their equivalents in expr. Newly written scripts should avoid expr in favor of the new features …

Occurrences

There are 3 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2003/occurrences/

(SH-2034) Unused variable

Description

Variables that are declared but not used for anything should be removed. #### Problematic code: bash foo=42 echo &quot;$FOO&quot; #### Preferred code: bash foo=42 echo &quot;$foo&quot; #### Exceptions: This warning may be falsely emitted when a variable is referenced indirectly, or it is intentionally not used. * Indirection: …

Occurrences

There are 10 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2034/occurrences/

Input/Output declarations


#input uu declares new input uu
#output yy declares new output yy

New output.txt allows new outputs to be computed in terms of states, etc.

Current input.txt allows new inputs to be defined.

It is up to the user to make sure equations are "sorted" - no algebraic manipulation is done.


(SH-2012) Consider using `find` instead of `ls` to better handle non-alphanumeric filenames

Description

Problematic code: bash ls -l | grep &quot; $USER &quot; | grep &#x27;\.txt$&#x27; NUMGZ=&quot;$(ls -l *.gz | wc -l)&quot; #### Preferred code: bash find . -maxdepth 1 -name &#x27;*.txt&#x27; -user &quot;$USER&quot; # Using the names of the files gz_files=(*.gz) numgz=${#gz_files[@]} # Sometimes, you just need a count

Occurrences

There are 3 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2012/occurrences/

tidy conflicts with HTML tidy

  • Transferred from https://sourceforge.net/p/mtt/bugs/35/
    • Status: open
    • Owner: nobody
    • Labels: MTT (33)
    • Priority: 5
    • Updated: 2005-06-24
    • Created: 2005-06-24
    • Creator: Geraint Paul Bevan
    • Private: No

The name of the "tidy" script conflicts with the
package tidy (an HTML processor) which results in
rdae.r being fed into the HTML package.

$ mtt -cc rc ode2odes cc
...
Creating rc_rdae.r fixing c and cc code
line 15 column 1 - Warning: missing <!DOCTYPE> declaration
line 15 column 1 - Warning: plain text isn't allowed in
<head> elements
line 15 column 1 - Warning: inserting missing 'title'
element
Info: Document content looks like HTML 3.2
3 warnings, 0 errors were found!
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 12 April 2005), see
www.w3.org">
<title></title>
</head>
<body>
in "rc_def.r"$ clear MTTdX;$ MATRIX MTTdX(1,1);$
MTTdX(1,1) :=
lin(r,flow,r,flow,1, -
lin(c,effort,c,effort,1,mttx1,state,1) +
mttu1,effort,1);$ clear MTTy;$ MATRIX MTTy(1,1);$
MTTy(1,1) :=
lin(c,effort,c,effort,1,mttx1,state,1);$ END;
</body>
</html>

To learn more about HTML Tidy see
http://tidy.sourceforge.net
Please send bug reports to [email protected]
HTML and CSS specifications are available from
http://www.w3.org/
Lobby your company to join W3C, see
http://www.w3.org/Consortium
make: *** [rc_rdae.r] Error 1
Exiting MTT with error 2
Exiting MTT with error 1

-cc .exe segfaults

  • Transferred from https://sourceforge.net/p/mtt/bugs/38/
    • Milestone: Bug
    • Status: open
    • Owner: Geraint Paul Bevan
    • Labels: MTT (33)
    • Priority: 7
    • Updated: 2005-09-27
    • Created: 2005-09-27
    • Creator: Peter Gawthrop
    • Private: No
mtt -cc rc odeso view
...
/bin/sh: line 1: 13634 Segmentation fault
./rc_ode2odes.exe >rc_odes.dat2

Segfault occurs after data generated.

Reply from Geraint Paul Bevan - 2005-09-27:

Logged In: YES
user_id=71249

I cannot reproduce this - it works fine for me. Is the problem repeatable?

(SH-2103) Consider using a `( subshell )` to avoid having to `cd` back

Description

When specifying a command such as cd dir; somestuff; cd .., cd dir can fail when permissions are lacking, if dir was deleted, or if dir is actually a file. <!--more--> In this case, somestuff will run in the wrong directory and cd .. will thus leave you in the …

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2103/occurrences/

state declaration


#state xx declares new state x; state.txt file updates this state.

It is up to the user to "sort" equations - no causal or algebraic processing done.


(SH-2125) Brace expansions/globs used in an assignment

Description

Brace expansions and globs are literal in assignments. Quote them or use an array. <!--more--> ## Examples ### Bad Practice sh foo={1..9} echo $foo ### Recommended: sh foo=( {1..9} ) echo &quot;${foo[@]}&quot; echo *.png {1..9} expands to all png files and numbers from 1 to 9, but var=*.png

Occurrences

There is 1 occurrence of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/reduce-algebra/mtt/issue/SH-2125/occurrences/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.