Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 293f6521cefb6dddb0bed178d44896a5069280e5f67cc21c182b96f22ed67abc
User & Date: gawthrop@users.sourceforge.net on 1998-03-31 11:10:44
Other Links: branch diff | manifest | tags
Context
1998-03-31
15:05:33
Spell checked check-in: e4949cb978 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
11:10:44
Initial revision check-in: 293f6521ce user: gawthrop@users.sourceforge.net tags: origin/master, trunk
08:39:31
Added EBTF check-in: 576c548a2b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/lib/comp/simple/EBTF_cause.m version [61b581107d].




































































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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
function [bonds,status] = EBTF_cause(bonds);
% EBTF_cause - causality for a EBTF component
% 
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%     %%%%% Model Transformation Tools %%%%%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% Matlab function  EBTF_cause
% [bonds,status] = EBTF_cause(bonds)

%SUMMARY EBTF: transformer component - bicausal on effort
%DESCRIPTION Energy conserving two-port
%DESCRIPTION e_1 f_1 = e_2 f_2 and e_1 and e_2 are both imposed.


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




% Copyright (c) P.J. Gawthrop, 1998.

% Check that there are exactly two bonds.
if check_bonds(bonds,2,'EBTF')==0
  return
end

% Effort must be imposed by both bonds
if (bonds(1,1)==-1)|(bonds(2,1)==-1) % Overcausal
  status = 1;
  return
end;

bonds(1,1) = 1; 
bonds(2,1) = 1;

% Flow bond must have through causality
if (bonds(1,2)==0)&(bonds(2,2)==0) % Undercausal
  status = -1;
  return
end;

if (bonds(1,2)==bonds(2,2))&(bonds(1,2)!=0) % Overcausal
  status = 1;
  return
end;

%Set flow causality
if (bonds(1,2)!=0)
  bonds(2,2) = -bonds(1,2)
else
  bonds(1,2) = -bonds(2,2)
end;
  
status = 0;







Added mttroot/mtt/lib/comp/simple/EBTF_eqn.m version [f9d4dc3a42].




















































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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
function  structure = EBTF_eqn(name,bond_number,bonds,direction,cr,args, ...
                            structure,eqnfile);

if nargin<8
  eqnfile = 'stdout';
end;

% Check that there are exactly two bonds.
if check_bonds(bonds,2,'EBTF')==0
  return
end

% There are 2 ports; extract the information
e_1 = bonds(1,1);
f_1 = bonds(1,2);
e_2 = bonds(2,1);
f_2 = bonds(2,2);


% Effort -- no equation

% Flow
effort1_name = varname(name,bond_number(1), 1);
effort2_name = varname(name,bond_number(2), 1);
flow1_name = varname(name,bond_number(1), -1);
flow2_name = varname(name,bond_number(2), -1);

if f_1==-1 %Write flow on port 2
  fprintf(eqnfile,'%s := (%s/%s)*%s;\n' , ...
      flow2_name, ...
      effort1_name, ...
      effort2_name, ...
      flow1_name);
else %Write flow on port 1
  fprintf(eqnfile,'%s := (%s/%s)*%s;\n' , ...
      flow1_name, ...
      effort2_name, ...
      effort1_name, ...
      flow2_name);
end;

 










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