Overview
Comment:New labg.fig rep - pretty LaTeX figures.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 87411098575918fd86981b138d2a6b677b43a6f2e95e54471260314e02b9de5a
User & Date: gawthrop@users.sourceforge.net on 2005-03-15 12:04:15
Other Links: branch diff | manifest | tags
Context
2005-03-15
12:49:28
Handle descriptive (inc maths) text as well check-in: 46adbfc048 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:04:15
New labg.fig rep - pretty LaTeX figures. check-in: 8741109857 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2005-03-04
09:19:53
Use exact solution - slow but accurate check-in: 8f3d434266 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [036c19267e] to [bc98e22955].

13
14
15
16
17
18
19



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







+
+
+







# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## 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
1906
1907
1908
1909
1910
1911
1912

1913
1914
1915
1916
1917
1918
1919
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923







+








# 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
1950
1951
1952
1953
1954
1955
1956

1957
1958
1959
1960
1961
1962
1963
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968







+








# 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.*
2966
2967
2968
2969
2970
2971
2972



2973
2974
2975
2976
2977
2978
2979
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987







+
+
+








$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


#Subsystem creation commands
#SUMMARY sub Executable subsystem list (sh)
ifeq ($start_at_abg,yes)
$1_sub.sh: $1_abg.m
	abg2sub_m2sh $1

Modified mttroot/mtt/bin/trans/rbg_fig2m from [0298389683] to [f5625fa473].

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
28







+
+
+
+







# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10  2002/04/28 18:55:03  geraint
## Fixed [ 549658 ] awk should be gawk.
## Replaced calls to awk with call to gawk.
##
## Revision 1.9  2002/01/11 03:44:19  geraint
## Breaks compounds objects into individual components. Eliminates "incorrect object code error" in cbg.ps when component is not causally complete.
##
## Revision 1.8  2001/10/15 14:25:44  gawthrop
## Now handles white space at the end of component names
## Converts ports lables [1:5] into [1,2,3,4,5]
##
41
42
43
44
45
46
47
























48
49
50
51
52
53
54
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82







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







# New path for awk script.
#
## Revision 1.1  1996/08/05 20:13:33  peter
## Initial revision
##
###############################################################

cmp2latex() {
  gawk '{
  ## Zap trailing null
  split($0,A,"\\");

  ## Find before and after:
  N=split(A[1],B,":");

  ## Split into fields
  M=split(B[1],C);

  ## Set special flag
  FlagCol = 9
  C[FlagCol] = 6;

  ## Write out modified version
  for (i=1;i<M;i++)
    printf("%s ",C[i]);
  if (N==1)
    printf("\\\\B{%s}\\001\n",C[M]);
  if (N==2)
    printf("\\\\BB{%s}{%s}\\001\n",C[M],B[2]);
  }'  
}

# 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"
100
101
102
103
104
105
106




107
108
109
110
111
112
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144







+
+
+
+






cat $1_lbl.txt $1_abg.mtt3 |  gawk -f $MTTPATH/trans/awk/rbg_fig2m.awk $1

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
cmp2latex<$1_cmp.fig  >$1_lcmp.fig
cat $1_head.fig $1_bnd.fig $1_lcmp.fig  > $1_labg.fig
strip_comments < $1_art.fig >> $1_labg.fig






Modified mttroot/mtt/doc/mtt.texi from [b57a402f91] to [a3aba9dc3c].

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.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
518
519
520
521
522
523
524

525
526
527
528
529
530
531
532
533
534
535
536
537
538
539







540
541
542
543
544
545
546
521
522
523
524
525
526
527
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
553
554
555
556
557







+















+
+
+
+
+
+
+








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) 

2691
2692
2693
2694
2695
2696
2697

2698
2699
2700
2701
2702
2703
2704
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716







+







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::  
2864
2865
2866
2867
2868
2869
2870
2871

2872
2873
2874
2875
2876
2877
2878
2876
2877
2878
2879
2880
2881
2882

2883
2884
2885
2886
2887
2888
2889
2890







-
+







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), Stripped acausal bond graph (sabg), Verbal description (desc), Representations
@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.
2897
2898
2899
2900
2901
2902
2903















2904

2905
2906
2907
2908
2909
2910
2911
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930

2931
2932
2933
2934
2935
2936
2937
2938







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







@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 (abg), Acausal bond graph (abg)
@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
3401
3402
3403
3404
3405
3406
3407
3408

3409
3410
3411
3412
3413
3414
3415
3428
3429
3430
3431
3432
3433
3434

3435
3436
3437
3438
3439
3440
3441
3442







-
+







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 (abg)
@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
3496
3497
3498
3499
3500
3501
3502
3503

3504
3505
3506
3507
3508
3509
3510
3523
3524
3525
3526
3527
3528
3529

3530
3531
3532
3533
3534
3535
3536
3537







-
+







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 (abg)
@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

3600
3601
3602
3603
3604
3605
3606
3607

3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618

3619
3620
3621
3622
3623
3624
3625
3627
3628
3629
3630
3631
3632
3633

3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644

3645
3646
3647
3648
3649
3650
3651
3652







-
+










-
+







@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 (abg)
@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 (abg), Representations
@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}.
4758
4759
4760
4761
4762
4763
4764



4765
4766
4767
4768
4769
4770
4771
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801







+
+
+







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

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% 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.
# %%


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