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
|
function [bonds,status] = juncause(bonds,jun,cause)
% [bonds,status] = juncause(bonds,jun,cause)
% Causality for either effort or flow on either zero or one junctions
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
j = (3-cause)/2; % j is 1 for effort, 2 for flow
[n_bonds,junk] = size(bonds);
[causing_bond, n,other_bonds,m] = getindex(bonds(:,j),jun);
if n>1 % over causal
status = 1;
elseif n==1 %causal
status = 0;
bonds(other_bonds(:,1),j) = -jun*ones(m,1);
else % undercausal - try other way
[causing_bond, n,other_bonds,m] = getindex(bonds(:,j),-jun);
if n==n_bonds % over causal
status = 1;
elseif n==n_bonds-1 %causal
status = 0;
bonds(other_bonds(:,1),j) = jun*ones(m,1);
else % undercausal
|
>
>
>
|
|
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] = juncause(bonds,jun,cause)
% [bonds,status] = juncause(bonds,jun,cause)
% Causality for either effort or flow on either zero or one junctions
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.1 1996/08/09 08:29:04 peter
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
j = (3-cause)/2; % j is 1 for effort, 2 for flow
[n_bonds,junk] = size(bonds);
[causing_bond, n,other_bonds,m] = getindex(bonds(:,j),jun);
if n>1 % over causal
status = 1;
elseif n==1 %causal
status = 0;
bonds(other_bonds(:,1),j) = -jun*ones(m,1);
elseif n==0 % undercausal - try other way
[causing_bond, n,other_bonds,m] = getindex(bonds(:,j),-jun);
if n==n_bonds % over causal
status = 1;
elseif n==n_bonds-1 %causal
status = 0;
bonds(other_bonds(:,1),j) = jun*ones(m,1);
else % undercausal
|