Overview
Comment:Updated documentation documentation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 610723402460b6989962fc4f9be974ca3c4b007b22f5252b953856c2b9e37a10
User & Date: gawthrop@users.sourceforge.net on 2002-09-19 08:10:47
Other Links: branch diff | manifest | tags
Context
2002-09-19
08:12:53
Merged version after documentation update check-in: e7cfed418f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
08:10:47
Updated documentation documentation check-in: 6107234024 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2002-09-18
19:46:49
Refined test to reduce shell loop overhead for unnecessary E matrix.
Removed unnecessary attempt to optimise cse.
Fixes sm representation.
check-in: 2613a4e855 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mttrc from [8938ad0cb4] to [8caf461eeb].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+









###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## 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.
##
198
199
200
201
202
203
204
205

206
207
208
209
210
211
212
201
202
203
204
205
206
207

208
209
210
211
212
213
214
215







-
+







  # Setup ps viewer
  export PSVIEW='gv'
  
  # Setup pdf viewer
  export PDFVIEW='acroread'
  
  # Setup html viewer
  export HTMLVIEW='netscape'
  export HTMLVIEW='mozilla'
  
  # Setup dvi viewer
  export DVIVIEW='xdvi'
  
  # Setup latex2html
  export LATEX2HTML="latex2html -contents_in_navigation -index_in_navigation -address http://mtt.sourceforge.net"
  

Modified mttroot/mtt/doc/mtt.texi from [c4eee9f1bd] to [8a28301cbc].

12
13
14
15
16
17
18



19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28







+
+
+









@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@comment  Version control history
@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@comment  $Id$
@comment  $Log$
@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
362
363
364
365
366
367
368

369
370
371
372
373
374
375
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379







+







* Introduction::                
* User interface::              
* Creating Models::             
* Simulation::                  
* Sensitivity models::          
* Representations::             
* Extending MTT::               
* Documentation::               
* Languages::                   
* Language tools::              
* Administration::              
* Glossary::                    
* Index::                       

@detailmenu
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
464
465
466
467
468
469
470

471
472
473
474
475
476
477







-








* Representation summary::      
* Defining representations::    
* Verbal description (desc)::   
* Acausal bond graph (abg)::    
* Stripped acausal bond graph (sabg)::  
* Labels (lbl)::                
* Description (desc)::          
* Structure (struc)::           
* Constitutive Relationship (cr)::  
* Parameters::                  
* Causal bond graph (cbg)::     
* Elementary system equations::  
* Differential-Algebraic Equations::  
* Constrained-state Equations::  
525
526
527
528
529
530
531
532

533
534
535
536
537
538
539
540
541

542
543
544
545
546
547
548
528
529
530
531
532
533
534

535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552







-
+









+








* Language fig (sabg.fig)::     
* Stripped acausal bond graph (view)::  

Labels (lbl)

* SS component labels ::        
* Other 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::                     
558
559
560
561
562
563
564
565

566
567
568
569
570
571
572
562
563
564
565
566
567
568

569
570
571
572
573
574
575
576







-
+








Old-style labels (lbl)

* SS component labels (old-style)::  
* Other component labels (old-style)::  
* Parameter passing (old-style)::  

Description (desc)
Parameter passing (old-style)

* Language tex (desc.tex)::     

Structure (struc)

* Language txt (struc.txt)::    
* Language tex (struc.tex)::    
653
654
655
656
657
658
659
660

661
662
















663
664
665
666
667
668
669
657
658
659
660
661
662
663

664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689







-
+


+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+








* Report (text)::               
* Report (view)::               

Extending MTT

* Makefiles::                   
* New representations::         
* 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::                           

2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2534
2535
2536
2537
2538
2539
2540

2541
2542
2543
2544
2545
2546
2547







-







@menu
* Representation summary::      
* Defining representations::    
* Verbal description (desc)::   
* Acausal bond graph (abg)::    
* Stripped acausal bond graph (sabg)::  
* Labels (lbl)::                
* Description (desc)::          
* Structure (struc)::           
* Constitutive Relationship (cr)::  
* Parameters::                  
* Causal bond graph (cbg)::     
* Elementary system equations::  
* Differential-Algebraic Equations::  
* Constrained-state Equations::  
2655
2656
2657
2658
2659
2660
2661
2662

2663
2664
2665
2666
2667
2668
2669
2674
2675
2676
2677
2678
2679
2680

2681
2682
2683
2684
2685
2686
2687
2688







-
+







(@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{Description (desc)})
        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
3425
3426
3427
3428
3429
3430
3431
3432

3433
3434
3435
3436
3437
3438
3439
3444
3445
3446
3447
3448
3449
3450

3451
3452
3453
3454
3455
3456
3457
3458







-
+







@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{Description (desc)}).
representation (@pxref{Detailed}).

@c      node   next  prev  up
@node   Stripped acausal bond graph (sabg), Labels (lbl), Acausal bond graph (abg), 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
3460
3461
3462
3463
3464
3465
3466
3467

3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481




3482
3483
3484


3485
3486
3487
3488
3489
3490
3491
3479
3480
3481
3482
3483
3484
3485

3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496




3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512







-
+










-
-
-
-
+
+
+
+



+
+







@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), Description (desc), Stripped acausal bond graph (sabg), Representations
@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 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 lable 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}
3538
3539
3540
3541
3542
3543
3544
3545

3546
3547
3548
3549
3550
3551
3552
3553
3554

3555
3556
3557

3558
3559
3560
3561
3562
3563
3564
3559
3560
3561
3562
3563
3564
3565

3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578

3579
3580
3581
3582
3583
3584
3585
3586







-
+









+


-
+









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 ::     
* 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)
@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.

3636
3637
3638
3639
3640
3641
3642
3643

3644
3645
3646
3647
3648
3649
3650
3658
3659
3660
3661
3662
3663
3664

3665
3666
3667
3668
3669
3670
3671
3672







-
+







* 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)
@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)}).

4051
4052
4053
4054
4055
4056
4057
4058

4059
4060
4061
4062
4063
4064
4065
4073
4074
4075
4076
4077
4078
4079

4080
4081
4082
4083
4084
4085
4086
4087







-
+







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),  , Parameter passing, Labels (lbl)
@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
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240

4241
4242
4243
4244
4245
4246
4247

4248
4249
4250
4251
4252
4253
4254
4239
4240
4241
4242
4243
4244
4245











4246
4247
4248
4249
4250

4251
4252
4253
4254
4255
4256
4257

4258
4259
4260
4261
4262
4263
4264
4265







-
-
-
-
-
-
-
-
-
-
-





-
+






-
+







%SUMMARY Pendulum example from Section 10.3 of "Metamodelling"

%Rod parameters
rod     none    l;l;j;m

@end example

@node Description (desc), Structure (struc), Labels (lbl), Representations
@comment  node-name,  next,  previous,  up
@section Description (desc)
@cindex Description
@cindex desc

The bond graph 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)}).

@menu
* Language tex (desc.tex)::     
@end menu

@node Language tex (desc.tex),  , Description (desc), Description (desc)
@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), Description (desc), Representations
@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
4577
4578
4579
4580
4581
4582
4583



4584
4585
4586
4587
4588
4589
4590
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604







+
+
+







# Generated by MTT at Mon Jun 16 15:10:17 BST 1997

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% 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
5457
5458
5459
5460
5461
5462
5463
5464

5465
5466
5467
5468
5469
5470
5471
5471
5472
5473
5474
5475
5476
5477

5478
5479
5480
5481
5482
5483
5484
5485







-
+







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{Description (desc)}), together with
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 <system> abg tex
@end example
where @code{<system>} is the name of the (top-level) system.

5479
5480
5481
5482
5483
5484
5485
5486

5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498

5499
5500
5501
5502

5503
5504
5505
5506
5507
5508
5509
5493
5494
5495
5496
5497
5498
5499

5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511

5512
5513
5514
5515

5516
5517
5518
5519
5520
5521
5522
5523







-
+











-
+



-
+







@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, Languages, Representations, Top
@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 representations::         
* New (DIY) representations::   
* Component library ::          
@end menu

@node Makefiles, New representations, Extending MTT, Extending MTT
@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
5528
5529
5530
5531
5532
5533
5534
5535

5536
5537

5538

5539
5540
5541
5542
5543

























5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560





5561





5562
5563


5564
5565

5566



5567

5568


5569
5570







5571
5572
5573
5574
5575
5576
5577















5578


5579
5580








5581


5582
5583






5584

5585
5586




5587
5588
5589





5590




5591
5592




5593








5594
5595


5596



5597
5598







5599




5600
5601





5602

5603
5604


5605


5606
5607



5608
5609
5610


5611
5612
5613








5614

5615
5616











5617



5618

5619



5620
5621




5622
5623

5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639










































































































5640

5641
5642
5643
5644
5645
5646
5647
5542
5543
5544
5545
5546
5547
5548

5549
5550

5551
5552
5553
5554
5555
5556
5557

5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594





5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605


5606
5607
5608

5609
5610
5611
5612
5613

5614
5615
5616
5617


5618
5619
5620
5621
5622
5623
5624
5625






5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643


5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654


5655
5656
5657
5658
5659
5660
5661
5662


5663
5664
5665
5666
5667


5668
5669
5670
5671
5672
5673
5674
5675
5676
5677


5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690


5691
5692
5693
5694
5695
5696


5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708


5709
5710
5711
5712
5713
5714
5715


5716
5717
5718
5719
5720


5721
5722
5723
5724


5725
5726
5727


5728
5729
5730
5731
5732
5733
5734
5735
5736
5737


5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752

5753
5754
5755
5756
5757


5758
5759
5760
5761
5762

5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885

5886
5887
5888
5889
5890
5891
5892
5893







-
+

-
+

+




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












-
-
-
-
-
+
+
+
+
+

+
+
+
+
+
-
-
+
+

-
+

+
+
+
-
+

+
+
-
-
+
+
+
+
+
+
+

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

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

+
+
-
-
+
+
+
+
+
+

+
-
-
+
+
+
+

-
-
+
+
+
+
+

+
+
+
+
-
-
+
+
+
+

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

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

+
+
+
+
-
-
+
+
+
+
+

+
-
-
+
+

+
+
-
-
+
+
+

-
-
+
+

-
-
+
+
+
+
+
+
+
+

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

+
+
+
-
+

+
+
+
-
-
+
+
+
+

-
+
















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








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 representations, Component library , Makefiles, Extending MTT
@node New (DIY) representations, Component library , Makefiles, Extending MTT
@comment  node-name,  next,  previous,  up
@section New representations
@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}).
(@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 `nppp' which is
created with the Octave script sys_nppp.m where `sys' is the system
name.  This needs a number of files (for exaample `sys_ode2odes.out')
which are themselves created by @strong{MTT}.
@example
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 nppp
# File nppp_rep.make
# Makefile for representation ident
# File ident_rep.make

#Copyright (C) 2000 by Peter J. Gawthrop
#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  
all: $(SYS)_nppp.$(LANG)
model_reps += ${SYS}_def.m 

## Prepend s to get the sensitivity targets
sensitivity_reps = ${model_reps:%=s%}
$(SYS)_nppp.view: $(SYS)_nppp.ps
        echo Viewing $(SYS)_nppp.ps; ghostview $(SYS)_nppp.ps&

## 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%}

$(SYS)_nppp.ps: $(SYS)_ode2odes.out s$(SYS)_ode2odes.out \
                $(SYS)_sim.m s$(SYS)_sim.m \
                $(SYS)_state.m $(SYS)_sympar.m $(SYS)_numpar.m  \
                s$(SYS)_state.m s$(SYS)_sympar.m s$(SYS)_numpar.m \
                $(SYS)_sm.m $(SYS)_def.m  s$(SYS)_def.m
        octave $(SYS)_nppp.m

## 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
$(SYS)_ode2odes.out: 
        mtt -q -c -stdin $(SYS) ode2odes out

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
s$(SYS)_ode2odes.out:
        mtt -q -c -stdin -s s$(SYS) ode2odes out

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

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

${gdatfiles}: ${datfiles}
$(SYS)_sim.m:
        mtt -q -c $(SYS) sim m
	ident_rep.sh ${SYS} gdat

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

s$(SYS)_sim.m:
        mtt -q -c -s s$(SYS) sim m
${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
$(SYS)_state.m:
        mtt -q $(SYS) state m

## 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 -q $(SYS) sympar m 
${SYS}_sympar.m:
	mtt ${SYS} sympar m

## Generic txt to m
${SYS}_%.m: ${SYS}_%.txt
	mtt ${OPTS} -q -stdin ${SYS} $* m
$(SYS)_numpar.m:
        mtt -q $(SYS) numpar 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
s$(SYS)_state.m:
        mtt -q -s s$(SYS) state m

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

## Sympar files
s$(SYS)_sympar.m :
        mtt -q -s s$(SYS) sympar m 
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)_numpar.m:
        mtt -q -s s$(SYS) numpar m

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

$(SYS)_sm.m:
        mtt -q $(SYS) sm m
s${SYS}_def.m:
	mtt -q -stdin ${OPTS} -s s${SYS} def m

$(SYS)_def.m:
        mtt -q $(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

@end verbatim
s$(SYS)_def.m:
        mtt -q -s s$(SYS) def m

@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)}).
@end example


@node Documentation (DIY representations),  , Shell-script (DIY representations), New (DIY) representations
@comment  node-name,  next,  previous,  up
@subsection Documentation
Future extensions of @strong{MTT} will use such representations stored
in $MTT_REP.
@cindex New representations
@cindex DIY representations
@cindex Documentation


@node Component library ,  , New representations, Extending MTT
@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 mtt.sf.netb
@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, Extending MTT, Top
@node   Languages, Language tools, Documentation, Top
@chapter Languages
@cindex Languages
@pindex Languages


@c      node   next  prev  up
@menu

Modified mttroot/mtt/lib/examples/Electrical/rc/rc_lbl.txt from [1e103cde3b] to [e0d18235d2].

1
2
3




4
5
6


7
8
9



10




11
12
13

14
15
16
17



18
19
20
21
22




23
24

25
26
27

28
29
30

31
32



1
2
3
4
5


6
7



8
9
10

11
12
13
14
15
16

17
18



19
20
21
22




23
24
25
26
27

28
29
30

31
32
33

34
35
36
-
-
-
+
+
+
+

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


-
+

-
-
-
+
+
+

-
-
-
-
+
+
+
+

-
+


-
+


-
+


%% Label file for system rc (rc_lbl.txt)
%SUMMARY rc
%DESCRIPTION 
## 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
# ###############################################################
# ## Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
# ###############################################################
# ## $Id$
# ## $Log$
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# ## Revision 1.1  2000/12/28 17:40:36  peterg
# ## To RCS
# ##
# ###############################################################


% Port aliases
# Port aliases

% Argument aliases
%ALIAS	$1	c
%ALIAS	$2	r
# 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
## Each 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 labels ----
	c	lin		effort,c

% Component type R
# Component type R
	r	lin		flow,r

% Component type SS
# Component type SS
	e1	SS		external,internal
	e2	SS		external,0

Modified mttroot/mtt/lib/rep/ident_rep.make from [0ce701c93b] to [a0d4f73f87].

1





2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10
11
12
13

+
+
+
+
+







# -*-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 

Modified mttroot/mtt/lib/rep/nppp_rep.make from [14d73e2a97] to [0545d82e23].

1




2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10
11
12

+
+
+
+







# -*-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 =  ${SYS}_sympar.m ${SYS}_simpar.m ${SYS}_state.m 


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