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: 19705ae149bea679be26c1684548dfc3ad9386f4eb14c922f34ea4d9a14f9565
User & Date: gawthrop@users.sourceforge.net on 1998-06-29 09:56:02
Other Links: branch diff | manifest | tags
Context
1998-06-29
09:56:03
Changed name from ES to FP check-in: 8d3e80c89b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
09:56:02
Initial revision check-in: 19705ae149 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1998-06-27
15:06:40
Initial revision check-in: d740da803b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/lib/comp/simple/FP_cause.m version [945d9753c5].



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
function [bonds,status] = FP_cause(bonds);
% Causality for FP component

%SUMMARY FP: converts thermal pseudobond to true bond and vv
%DESCRIPTION Port [e]: temperature (T) / enthalpy flow (E) bond
%DESCRIPTION Port [s]: temperature (T) / entropy flow (S) bond



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.1  1997/09/04  08:34:53  peterg
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


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

status = -1;

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

% Same causality as TF
[bonds,status] = TF_cause(bonds);


Added mttroot/mtt/lib/comp/simple/FP_eqn.m version [d3b833050d].























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
68
69
70
71
72
73
74
75
function  structure = ES_eqn(name,bond_number,bonds,direction,cr,args, ...
    structure,eqnfile);
% ES_eqn - equations for ES component
% 
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%     %%%%% Model Transformation Tools %%%%%
%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% Matlab function  ES_eqn
% ES_eqn(name,bond_number,bonds,direction,cr,args, ...
%    structure,eqnfile);



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.3  1998/03/27 10:59:43  peterg
% %% Zapped t_0 again ...
% %%
% %% Revision 1.2  1998/02/25 16:59:56  peterg
% %% Corrected enthalpy-entropy conversion -- use temp on the entropy side.
% %%
% %% Revision 1.1  1998/02/25 15:03:51  peterg
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


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


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

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


% There are 2 ports; extract the information
e_bond = bonds(1,:);
s_bond = bonds(2,:);

% The efforts are the same - but the enthalpy side has relative T
if e_bond(1)==1 %effort imposed on the enthalpy bond 
%  fprintf(eqnfile,'%s := %s + t_0;\n' , ...
  fprintf(eqnfile,'%s := %s;\n' , ...
    varname(name,bond_number(2), 1), ...
    varname(name,bond_number(1), 1) );
else %effort imposed on the entropy bond 
%  fprintf(eqnfile,'%s := %s - t_0;\n' , ...
  fprintf(eqnfile,'%s := %s;\n' , ...
    varname(name,bond_number(1), 1), ...
    varname(name,bond_number(2), 1) );
end;

% The flows need to be converted - use the absolute temp on the
% entropy side
if e_bond(2)==-1 %flow imposed on the enthalpy bond 
  fprintf(eqnfile,'%s := %s/%s;\n' , ...
    varname(name,bond_number(2), -1), ...
    varname(name,bond_number(1), -1), ...
    varname(name,bond_number(2), 1) );
else % flow imposed on the entropy bond 
    fprintf(eqnfile,'%s := %s*%s;\n' , ...
    varname(name,bond_number(1), -1), ...
    varname(name,bond_number(2), -1), ...
    varname(name,bond_number(2), 1) );
end;


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