* Example 8:
echo Example 8:
* compute reliability of a system with 40 components
* in series, where each of these components is composed
* of 2 subcomponents in parallel.

format 8

block opt
comp S exp(1.0)
parallel CP S S
series C1 CP CP CP CP CP CP CP CP CP CP 
series sys1 C1 C1 C1 C1 
end

* The reason for commenting out the next two commands is that they
* give rise to instability. The alternative methods of computation
* are given next.
*cdf(opt)
*eval (opt) .1 1 .1

* alternate way of computing the values of the cdf at some values of t:
* assign each component its failure probability at t.
* this is the same, essentially, as using tvalue.
* theoretically, zero(alt;t), tvalue(t;opt) and value(t;opt)
* should give the same answer.

func g(t) 1-^(-t)

block alt(t)
comp S prob(g(t))
parallel CP S S
series C1 CP CP CP CP CP CP CP CP CP CP 
series sys1 C1 C1 C1 C1 
end

loop t, .1, 1, .1
    expr pzero(alt;t), tvalue (t; opt)
end

end


