49 lines
1.1 KiB
Plaintext
49 lines
1.1 KiB
Plaintext
##
|
|
# GNUPLOT SCRIPT to plot XFMEA FMMD reasoning distance
|
|
# comparisons.
|
|
#
|
|
#
|
|
# alway define fp in declaration, as in 'C'
|
|
# or gnuplot treats these as integers.
|
|
#
|
|
# number of failure modes per component
|
|
fm = 3.0
|
|
|
|
# number of components in each functional group
|
|
k = 3.0
|
|
|
|
# place the functional group size and failure mode per components
|
|
# size into a string to use as the graph title
|
|
#
|
|
tt = sprintf("reasoning distance comparison for |fg| = %d and |fm| = %d", k, fm)
|
|
set title tt
|
|
|
|
a = 0.0
|
|
b = 0.0
|
|
|
|
# formula for reasoning distance in one level of FMMD
|
|
# hierarchy (as given by ll)
|
|
#
|
|
fmmd(ll)=k**ll * k * fm * (k - 1)
|
|
|
|
# set up iterative sum in gnuplot syntax
|
|
# to iterate over FMMD levels
|
|
#
|
|
sum(a,b) = (a > b) ? 0 : fmmd(a) + sum(a+1, b)
|
|
sig_fx(c) = sum(a,c)
|
|
|
|
# reasoning distance for exhaustive case in FMEA
|
|
# where ll is the hierarchy level
|
|
xfmea(ll) = k**(ll+1) * ( k**(ll+1) -1 ) * fm
|
|
|
|
|
|
set xrange [0:1000]
|
|
set xlabel "Component count"
|
|
set ylabel "reasoning distance"
|
|
set logscale y
|
|
|
|
set terminal png
|
|
set output 'xfmea_fmmd_comp.png'
|
|
plot sig_fx(x**(1/k)), xfmea(x**(1/k))
|
|
#!sleep 20
|