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
76
77
78
|
ports = 2;
if check_bonds(bonds,ports,'FP')==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;
|
|
|
|
|
|
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
|
ports = 2;
if check_bonds(bonds,ports,'FP')==0
return
end
% There are 2 ports; extract the information
f_bond = bonds(1,:);
p_bond = bonds(2,:);
% The efforts are the same - but the enthalpy side has relative T
if f_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 f_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;
|