Hello everyone,
I'm struggling with Appling a method of finding a minimal cut set from a fault tree (The method and a FTA tutorial was presented by P.L Clemens in may 1993, you can find it here - Clemens Fta Tutorial - [PDF Document]).
the method explanation in these steps (illustration is in the added image, letters represent logic gates, European (hindu-arabic) numbers represent primary events, Roman numbers represent Main and intermediate events):
a - insert the first logic gate letter in a cell (Ignore all Roman numbers through the process).
b - if the logic gate type is "AND" then replace that cell with successive cells in its row with the values of the logic gate inputs (in the example - cell "A" is replaced with the successive cells "B" & "D" in its row), if the logic gate type is "OR" then replace that cell with successive cells in its column with the values of the logic gate inputs.
c - Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "B" (which is an "OR" logic gate type) is replaced with the successive cells "1" & "C" in its column, and all other adjacent cells in the same row of the original cell "B" ,that was replaced, is being copied to the new row, next to the new successive cell "C" - in the example the only cell that is being copied is the cell that holds the input value "D"].
d- Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "C" (which is an "AND" logic gate type) is replaced with the successive cells "2" & "3" in its row, the existing cells in the row is untouched (in the example - cell "D") so the successive cell (in the example - cell "3") is added from the right and creates a new column (without adding any copied cells above or below its row).
e - Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "D" (which is an "OR" logic gate type) is replaced with the successive cells "2" & "4" in its column, and all other adjacent cells in the same row of the original cell "D" ,that was replaced, is being copied to the new row, next to the new successive cell "4" - in the example the cell that is being copied is the cell that holds the input value "1"].
f - Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "D" (which is an "OR" logic gate type) is replaced with the successive cells "2" & "4" in its column, and all other adjacent cells in the same row of the original cell "D" ,that was replaced, is being copied to the new row, next to the new successive cell "4" - in the example the cells that are being copied are the cells that holds the input values "2" & "3"].
g - look for repeating cells in each row and if you find any, delete them except one (so that every cell in a row has a singular value in that row), next - Densify the cells so that no cells remain empty (in the example - the cell that held the value "3" moved left and replaced the deleted cell that held the value "2").
h - If there is a row of cells that has all the cell values of a shorter row in the matrix - DELETE THE LONGER ROW (in the example the row that has cells with the values "2", "4", "3" was deleted because there is a shorter row in the matrix that Its only cells has the values "2" & "3").
i - the result is the minimal cut set.
Please help me make it happen, preferably with VBA and an option of a 100 inputs for each logic gate, and as many logic gates as possible.
I'm struggling with Appling a method of finding a minimal cut set from a fault tree (The method and a FTA tutorial was presented by P.L Clemens in may 1993, you can find it here - Clemens Fta Tutorial - [PDF Document]).
the method explanation in these steps (illustration is in the added image, letters represent logic gates, European (hindu-arabic) numbers represent primary events, Roman numbers represent Main and intermediate events):
a - insert the first logic gate letter in a cell (Ignore all Roman numbers through the process).
b - if the logic gate type is "AND" then replace that cell with successive cells in its row with the values of the logic gate inputs (in the example - cell "A" is replaced with the successive cells "B" & "D" in its row), if the logic gate type is "OR" then replace that cell with successive cells in its column with the values of the logic gate inputs.
c - Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "B" (which is an "OR" logic gate type) is replaced with the successive cells "1" & "C" in its column, and all other adjacent cells in the same row of the original cell "B" ,that was replaced, is being copied to the new row, next to the new successive cell "C" - in the example the only cell that is being copied is the cell that holds the input value "D"].
d- Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "C" (which is an "AND" logic gate type) is replaced with the successive cells "2" & "3" in its row, the existing cells in the row is untouched (in the example - cell "D") so the successive cell (in the example - cell "3") is added from the right and creates a new column (without adding any copied cells above or below its row).
e - Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "D" (which is an "OR" logic gate type) is replaced with the successive cells "2" & "4" in its column, and all other adjacent cells in the same row of the original cell "D" ,that was replaced, is being copied to the new row, next to the new successive cell "4" - in the example the cell that is being copied is the cell that holds the input value "1"].
f - Replace the leftmost and topmost cell that holds an input value that is not a number [in the example - cell "D" (which is an "OR" logic gate type) is replaced with the successive cells "2" & "4" in its column, and all other adjacent cells in the same row of the original cell "D" ,that was replaced, is being copied to the new row, next to the new successive cell "4" - in the example the cells that are being copied are the cells that holds the input values "2" & "3"].
g - look for repeating cells in each row and if you find any, delete them except one (so that every cell in a row has a singular value in that row), next - Densify the cells so that no cells remain empty (in the example - the cell that held the value "3" moved left and replaced the deleted cell that held the value "2").
h - If there is a row of cells that has all the cell values of a shorter row in the matrix - DELETE THE LONGER ROW (in the example the row that has cells with the values "2", "4", "3" was deleted because there is a shorter row in the matrix that Its only cells has the values "2" & "3").
i - the result is the minimal cut set.
Please help me make it happen, preferably with VBA and an option of a 100 inputs for each logic gate, and as many logic gates as possible.
Book3 (version 1).xlsm | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | Event | Logic Gate # | Logic gate Type | Logic Gate Inputs | ||||||||
2 | I | A | AND | B | ||||||||
3 | D | a | A | |||||||||
4 | ||||||||||||
5 | b | B | D | |||||||||
6 | ||||||||||||
7 | c | 1 | D | |||||||||
8 | C | D | ||||||||||
9 | ||||||||||||
10 | d | 1 | D | |||||||||
11 | 2 | D | 3 | |||||||||
12 | II | B | OR | 1 | ||||||||
13 | C | e | 1 | 2 | ||||||||
14 | 2 | D | 3 | |||||||||
15 | 1 | 4 | ||||||||||
16 | ||||||||||||
17 | f | 1 | 2 | |||||||||
18 | 2 | 2 | 3 | |||||||||
19 | 1 | 4 | ||||||||||
20 | 2 | 4 | 3 | |||||||||
21 | ||||||||||||
22 | III | C | AND | 2 | g | 1 | 2 | |||||
23 | 3 | 2 | 2 | 3 | ||||||||
24 | 1 | 4 | ||||||||||
25 | 2 | 4 | 3 | |||||||||
26 | ||||||||||||
27 | h | 1 | 2 | |||||||||
28 | 2 | 3 | ||||||||||
29 | 1 | 4 | ||||||||||
30 | 2 | 4 | 3 | |||||||||
31 | ||||||||||||
32 | IV | D | OR | 2 | i | 1 | 2 | |||||
33 | 4 | 2 | 3 | |||||||||
34 | 1 | 4 | ||||||||||
35 | ||||||||||||
36 | ||||||||||||
37 | ||||||||||||
38 | ||||||||||||
39 | ||||||||||||
40 | ||||||||||||
41 | ||||||||||||
42 | ||||||||||||
Sheet2 |