Overview
Comment:Added dummy first argument (comp_type) to cr
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 392fcc96e7d9ddb99946e9fadfc25daee08c5741a578d46c4941a6ae03f7b559
User & Date: gawthrop@users.sourceforge.net on 2003-01-09 09:57:42
Other Links: branch diff | manifest | tags
Context
2003-01-15
16:49:10
New structure conversion script check-in: 30e7e30245 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2003-01-09
09:57:42
Added dummy first argument (comp_type) to cr check-in: 392fcc96e7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2003-01-07
21:47:35
Added causal stroke information to ibg.m check-in: f9063ea06a user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/cr/r/cr.cr from [8711e303bd] to [df142395b3].

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
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
37










+
+
+
















-
+







%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.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 eqn,outlist,inputs 
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;
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
83


84
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
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
83
84


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
112







-
-
+
+



-
-
+
+



-
-
+
+



-
-
+
+




-
-
+
+



-
-
+
+



-
-
+
+



-
-
+
+




-
-
+
+





% 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 mtt_cr, input, out_cause
LET cr(mtt_cr,out_cause, 1, input, flow, 1) 
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 mtt_cr, input, out_cause
LET cr(mtt_cr,out_cause, 1, input, effort, 1)
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 mtt_cr, input, in_cause
LET cr(mtt_cr,effort, 1, input, in_cause, 1) 
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 mtt_cr, input, in_cause
LET cr(mtt_cr,flow, 1, input, in_cause, 1) 
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 mtt_cr_e,mtt_cr_f, input, out_cause
LET cr(mtt_cr_e,mtt_cr_f,out_cause, 1, input, flow, 1) 
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 mtt_cr_e,mtt_cr_f, input, out_cause
LET cr(mtt_cr_e,mtt_cr_f,out_cause, 1, input, effort, 1) 
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 mtt_cr_e,mtt_cr_f, input, in_cause
LET cr(mtt_cr_e,mtt_cr_f,effort, 1, input, in_cause, 1) 
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 mtt_cr_e,mtt_cr_f, input, in_cause
LET cr(mtt_cr_e,mtt_cr_f,flow, 1, input, in_cause, 1) 
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 mtt_cr_e,mtt_cr_f,input_1,input_2
LET cr(mtt_cr_e,mtt_cr_f,flow,1,
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));

END;


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