-
Notifications
You must be signed in to change notification settings - Fork 15
/
mech_pid_from_ped.m
37 lines (31 loc) · 955 Bytes
/
mech_pid_from_ped.m
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
function pid = mech_pid_from_ped(lat)
% calculate full PID (including ambiguous terms) from a PED
if lat.Nx ~= 3
error('only 2 variable PID supported')
end
pid = zeros(1,5);
n = lat.nodes;
mech = abs( min( lat.PI(n('{1}{2}')), 0) );
% source redundancy
pid(1) = lat.PI(n('{1}{2}{3}')) - mech;
% mechanistic redundancy
pid(2) = mech ...
- lat.PI(n('{13}{23}')) ...
- lat.PI(n('{12}{13}{23}'));
% unique info
pid(3) = lat.PI(n('{1}{3}')) ...
- lat.PI(n('{13}')) ...
- lat.PI(n('{12}{13}')) ...
- lat.PI(n('{2}{13}'));
pid(4) = lat.PI(n('{2}{3}')) ...
- lat.PI(n('{23}')) ...
- lat.PI(n('{12}{23}')) ...
- lat.PI(n('{1}{23}'));
% synergy
pid(5) = lat.PI(n('{3}{12}')) ...
+ lat.PI(n('{12}{13}')) ...
+ lat.PI(n('{12}{23}')) ...
+ lat.PI(n('{12}{13}{23}')) ...
+ lat.PI(n('{1}{23}')) ...
+ lat.PI(n('{2}{13}')) ...
- lat.PI(n('{123}'));