Overview
Comment:Merge pull request #18 from reduce-algebra/restyled/deepsource-transform-1fe15620

Restyle Format code with black, gofmt, yapf, autopep8, isort, standardrb, standardjs, prettier and rubocop

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk | master
Files: files | file ages | folders
SHA3-256: a8cce33cfa1403045c4547920e25e17df5a3b6b2a849dac5af94132b62d7d610
User & Date: trnsz@pobox.com on 2021-04-17 06:06:41
Other Links: manifest | tags
Context
2021-04-17
06:06:41
Merge pull request #18 from reduce-algebra/restyled/deepsource-transform-1fe15620

Restyle Format code with black, gofmt, yapf, autopep8, isort, standardrb, standardjs, prettier and rubocop Leaf check-in: a8cce33cfa user: trnsz@pobox.com tags: master, trunk

06:05:54
Merge pull request #17 from reduce-algebra/deepsource-transform-1fe15620

Format code with black, gofmt, yapf, autopep8, isort, standardrb, standardjs, prettier and rubocop check-in: 0ade40978e user: trnsz@pobox.com tags: master, trunk

2021-04-16
07:13:11
Restyled by whitespace Leaf check-in: e824121e11 user: commits@restyled.io tags: github/restyled/deepsource-transform-1fe15620, trunk
Changes

Modified LICENSE.md from [7824ce41c5] to [96af4d2315].

1
2
3
4


5
6
7
8
9
10
11
1
2


3
4
5
6
7
8
9
10
11


-
-
+
+







# 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
> 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
85
86
87
88
89
90
91
92
93
94



95
96
97
98
99
100
101
102
103
104









105
106
107
108
109
110
111
85
86
87
88
89
90
91



92
93
94
95









96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111







-
-
-
+
+
+

-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+







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.
  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.)
- **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
123
124
125
126
127
128
129
130
131


132
133
134
135
136
137


138
139
140
141
142


143
144
145
146
147
148
149
150
123
124
125
126
127
128
129


130
131
132
133
134
135


136
137
138
139
140


141
142

143
144
145
146
147
148
149







-
-
+
+




-
-
+
+



-
-
+
+
-







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,
  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,
  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
  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.)
  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

Modified README.md from [a41249c324] to [da8a56cfa1].

1
2
3
4
5
6
7



8
9
10
11
12
13
14
15
16






17
18
19
20
21
22
23
1
2
3
4
5
6

7
8
9
10
11
12
13
14
15
16


17
18
19
20
21
22
23
24
25
26
27
28
29






-
+
+
+







-
-
+
+
+
+
+
+







# 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.
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.
- 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)
40
41
42
43
44
45
46
47
48






49
50
46
47
48
49
50
51
52


53
54
55
56
57
58
59
60







-
-
+
+
+
+
+
+



- [GitHub Issues](https://github.com/reduce-algebra/mtt/issues)

---

## Authors

- [Peter Gawthrop](http://www.gawthrop.net/) [\<peter.gawthrop@unimelb.edu.au\>](mailto:peter.gawthrop@unimelb.edu.au)
- [Geraint Paul Bevan](https://www.gcu.ac.uk/cebe/staff/geraint%20bevan/) [\<Geraint.Bevan@gcu.ac.uk\>](mailto:Geraint.Bevan@gcu.ac.uk), [\<geraint@enchant.me.uk\>](mailto:geraint@enchant.me.uk) [_(https://www.enchant.me.uk)_](https://www.enchant.me.uk/)
- [Peter Gawthrop](http://www.gawthrop.net/)
  [\<peter.gawthrop@unimelb.edu.au\>](mailto:peter.gawthrop@unimelb.edu.au)
- [Geraint Paul Bevan](https://www.gcu.ac.uk/cebe/staff/geraint%20bevan/)
  [\<Geraint.Bevan@gcu.ac.uk\>](mailto:Geraint.Bevan@gcu.ac.uk),
  [\<geraint@enchant.me.uk\>](mailto:geraint@enchant.me.uk)
  [_(https://www.enchant.me.uk)_](https://www.enchant.me.uk/)

---

Modified SECURITY.md from [a45c510c57] to [19071b59c9].

1
2
3
4
5
6
7
8
9








1
2
3
4
5
6



7
8
9
10
11
12
13
14






-
-
-
+
+
+
+
+
+
+
+
# Security Information

## Reporting a Vulnerability

Please use email to report any any security vulnerabilities:

- [Peter Gawthrop](http://www.gawthrop.net/) [\<peter.gawthrop@unimelb.edu.au\>](mailto:peter.gawthrop@unimelb.edu.au)
- [Geraint Paul Bevan](https://www.gcu.ac.uk/cebe/staff/geraint%20bevan/) [\<Geraint.Bevan@gcu.ac.uk\>](mailto:Geraint.Bevan@gcu.ac.uk), [\<geraint@enchant.me.uk\>](mailto:geraint@enchant.me.uk) [_(https://www.enchant.me.uk)_](https://www.enchant.me.uk/)
- [Jeffrey H. Johnson](https://prone.ws/) [\<trnsz@pobx.com\>](mailto:trnsz+reduce-algebra-mtt-security@pobox.com)
- [Peter Gawthrop](http://www.gawthrop.net/)
  [\<peter.gawthrop@unimelb.edu.au\>](mailto:peter.gawthrop@unimelb.edu.au)
- [Geraint Paul Bevan](https://www.gcu.ac.uk/cebe/staff/geraint%20bevan/)
  [\<Geraint.Bevan@gcu.ac.uk\>](mailto:Geraint.Bevan@gcu.ac.uk),
  [\<geraint@enchant.me.uk\>](mailto:geraint@enchant.me.uk)
  [_(https://www.enchant.me.uk)_](https://www.enchant.me.uk/)
- [Jeffrey H. Johnson](https://prone.ws/)
  [\<trnsz@pobx.com\>](mailto:trnsz+reduce-algebra-mtt-security@pobox.com)

Modified mtt/doc/mtt.html from [1a30bfd2d6] to [c4984a2298].

3521
3522
3523
3524
3525
3526
3527
3528

3529
3530
3531
3532
3533
3534
3535
3521
3522
3523
3524
3525
3526
3527

3528
3529
3530
3531
3532
3533
3534
3535







-
+







    <table>
      <tr>
        <td></td>
        <td class="example">
          <pre>
       mtt help representations
       mtt help components
       mtt help examples 
       mtt help examples
       mtt help crs
       mtt help representations &lt;match_string&gt;
       mtt help components &lt;match_string&gt;
       mtt help examples  &lt;match_string&gt;
       mtt help crs &lt;match_string&gt;
       mtt help &lt;component_or_example_or_CR_name&gt;
</pre
10562
10563
10564
10565
10566
10567
10568
10569

10570
10571
10572
10573
10574
10575
10576
10562
10563
10564
10565
10566
10567
10568

10569
10570
10571
10572
10573
10574
10575
10576







-
+







    </table>
    where n is an integer (unique within the label file). For example
    <table>
      <tr>
        <td></td>
        <td class="example">
          <pre>
%ALIAS  $a1  lin           
%ALIAS  $a1  lin
</pre
          >
        </td>
      </tr>
    </table>
    assigns the symbolic parameter to be lin. This parameter <code>$1</code> can
    then be used for passing a diofferent cr to the component (see section
10618
10619
10620
10621
10622
10623
10624
10625

10626
10627
10628
10629
10630
10631
10632
10618
10619
10620
10621
10622
10623
10624

10625
10626
10627
10628
10629
10630
10631
10632







-
+







    <!--docid::SEC96::-->
    <p>Component aliases are of the form</p>
    <table>
      <tr>
        <td></td>
        <td class="example">
          <pre>
%ALIAS Component_name   Component_location       
%ALIAS Component_name   Component_location
</pre
          >
        </td>
      </tr>
    </table>
    <p>An example appears in the following label file fragment</p>
    <table>
11853
11854
11855
11856
11857
11858
11859
11860

11861
11862
11863
11864
11865
11866
11867
11853
11854
11855
11856
11857
11858
11859

11860
11861
11862
11863
11864
11865
11866
11867







-
+







    <table>
      <tr>
        <td></td>
        <td class="example">
          <pre>
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);      
        = tank(rho,g,vol,h,topt,bott,press);
</pre
          >
        </td>
      </tr>
    </table>
    Assuming that `tank' is not defined in a reduce file, MTT will leave it
    unresolved when generating m or c code.
11922
11923
11924
11925
11926
11927
11928
11929

11930
11931

11932
11933
11934
11935
11936
11937
11938
11922
11923
11924
11925
11926
11927
11928

11929
11930

11931
11932
11933
11934
11935
11936
11937
11938







-
+

-
+







        <td></td>
        <td class="example">
          <pre>
function p = tank (rho,g,vol,h,topt,bott,press)

  ## usage:  p = tank (vol,h,topt,bott,press)
  ##
  ## 
  ##

   val = press; zt = topt; zb = bott; 
   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
</pre
          >
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996






11997
11998
11999
12000
12001
12002
12003
11984
11985
11986
11987
11988
11989
11990






11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003







-
-
-
-
-
-
+
+
+
+
+
+







    Following the example of the previous section, the unresolved CR `tank' can
    be expressed in c++ code. For example:
    <table>
      <tr>
        <td></td>
        <td class="example">
          <pre>
inline double tank(const double rho, 
                   const double g, 
                   const double vol, 
                   const double h, 
                   const double topt, 
                   const double bott, 
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)
    ##
    ##
  */
14789
14790
14791
14792
14793
14794
14795
14796

14797
14798

14799
14800
14801
14802
14803
14804
14805
14789
14790
14791
14792
14793
14794
14795

14796
14797

14798
14799
14800
14801
14802
14803
14804
14805







-
+

-
+







    <table>
      <tr>
        <td></td>
        <td class="example">
          <pre>
# Makefile for the Two link GMV example

all: msdP_tf.m TwoLinkP_obs.m TwoLinkP_sm.m twolinkp_sm.m TwoLinkGMV_numpar.m 
all: msdP_tf.m TwoLinkP_obs.m TwoLinkP_sm.m twolinkp_sm.m TwoLinkGMV_numpar.m

msdP_tf.m: msdP_abg.fig 
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
16370
16371
16372
16373
16374
16375
16376
16377

16378
16379
16380
16381
16382
16383
16384
16370
16371
16372
16373
16374
16375
16376

16377
16378
16379
16380
16381
16382
16383
16384







-
+








B = 10

C = 1

D = 0

octave&gt; 
octave&gt;
</pre
          >
        </td>
      </tr>
    </table>
    generates the data structure rc corresponding the the bond graph of the
    system called `rc'. The following octave commands then generate the step
16815
16816
16817
16818
16819
16820
16821
16822

16823
16824
16825
16826
16827
16828
16829
16815
16816
16817
16818
16819
16820
16821

16822
16823
16824
16825
16826
16827
16828
16829







-
+







      installed, this may be done with the command
    </p>
    <table>
      <tr>
        <td></td>
        <td class="example">
          <pre>
  mtt sys sfun mexglx 
  mtt sys sfun mexglx
</pre
          >
        </td>
      </tr>
    </table>
    <p>
      which will generated the four .mex files and the .mdl file. In this case,


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]