Build Hierarchical Reliability Models
Build Hierarchical Reliability Models
Nest distributions to build up a hierarchy.
{Subscript[𝒟, x], Subscript[𝒟, y], Subscript[𝒟, orig], Subscript[𝒟, repl]} = {ExponentialDistribution[(1/3)], ExponentialDistribution[(1/4)], ExponentialDistribution[(1/6)], ExponentialDistribution[(1/2)]};Subscript[𝒟, r] = ReliabilityDistribution[x∨y, {{x, Subscript[𝒟, x]}, {y, Subscript[𝒟, y]}}];
Subscript[𝒟, s] = StandbyDistribution[Subscript[𝒟, orig], {Subscript[𝒟, repl]}];
Subscript[𝒟, sys] = ReliabilityDistribution[r∧s, {{r, Subscript[𝒟, r]}, {s, Subscript[𝒟, s]}}];tmax = 15;
vfuncpar[{x_, y_}, start | end | start2 | end2, {w_, h_}] := {StandardGray, Rectangle[{x - w / 2, y - h / 2}, {x + w / 2, y + h / 2}]};
vfuncpar[{x_, y_}, v_, {w_, h_}] := Inset[Plot[SurvivalFunction[Subscript[𝒟, v], t], {t, 0, tmax}, Filling -> Axis, Axes -> None, Frame -> True, FrameTicks -> None, FillingStyle -> Extract[Reverse@ColorData[45, "ColorList"], Position[vl, v]], Background -> StandardBrown, PlotRange -> {0, 1}], {x, y}, {tmax / 2, 0.5}, {1.5w, 1.5h}];
edgefunc[points_, origrepl] := {Dashed, Black, Arrowheads[Medium], Arrow[{{8.5, 1}, {10.5, 1}, {10.5, -0.2}}]};
vl = {start, end, x, y, orig, repl, start2, end2, r, s, sys};
vlabels = Thread[{start, end, x, y, orig, repl, start2, end2, r, s, sys} -> Map[Placed[#, Center]&, {"Start", "End", "SubscriptBox[𝒟, x]", "SubscriptBox[𝒟, y]", "SubscriptBox[𝒟, orig]", "SubscriptBox[𝒟, repl]", "Start", "End", "SubscriptBox[𝒟, r]", "SubscriptBox[𝒟, s]", "SubscriptBox[𝒟, sys]"}]];
Graph[vl, {startx, starty, xend, yend, Annotation[origrepl, EdgeShapeFunction -> edgefunc], start2r, rs, send2}, VertexCoordinates -> {{0.5, 0}, {5.5, 0}, {3, 1}, {3, -1}, {8.5, 1}, {10.5, -1}, {1, 5}, {10.5, 5}, {4, 5}, {7.5, 5}, {5.75, 9.5}}, VertexSize -> {sys -> {"Scaled", 0.5}, {"Scaled", 0.25}}, VertexShapeFunction -> vfuncpar, VertexLabelStyle -> 20, VertexLabels -> vlabels, Prolog -> {EdgeForm[Thin], FaceForm[Blue], Rectangle[{-0.6, -2}, {6.6, 2}], Rectangle[{7, -2}, {12, 2}], Rectangle[{-0.3, 3.7}, {11.8, 6.3}], Arrow[{{3, 2}, {4, 5}}, {0, 1}], Arrow[{{9.5, 2}, {7.5, 5}}, {0, 1}], Arrow[{{5.75, 6.3}, {5.75, 9.5}}, {0, 1.7}]}, PlotRange -> {{-0.6, 12.1}, {-2.1, 11.3}}, ImageSize -> Medium]