membrane

Summary

A statistical model is used to predict the probability of failure for the membrane.

  • Resistance: membrane service life

  • Load: age

  • limit-state: age >= service life.

class membrane.MembraneModel(pars)[source]

Bases: object

calibrate(membrane_age_field, membrane_failure_ratio_field)[source]

Calibrate membrane model to field condition

Parameters:
  • membrane_age_field (float, int) – membrane age when membrane failure rate is surveyed

  • membrane_failure_ratio_field (float) – failure rate e.g. 0.1 for 10%

Returns:

calibrated model

Return type:

membrane model object instance

copy()[source]

create a deepcopy

membrane_failure_with_year(year_lis, plot=True, amplify=80)[source]

Solve pf, beta at a list of time steps with plot option.

Parameters:

year_lislist, array-like

A list of time steps.

plotbool, optional

If True, plot the Pf, beta, R S distribution. Default is True.

amplifyint, optional

The arbitrary comparable size of the distribution curve. Default is 80.

Returns:

tuple

(pf array, beta array)

postproc(plot=False)[source]

Solve pf, beta, attach R distribution with plot option.

Parameters:

plotbool, optional

If True, plot the distributions. Default is False.

run(t)[source]

Attach the resistance: membrane age.

Parameters:

tint, float

Membrane age.

membrane.calibrate_f(model_raw, t, membrane_failure_ratio_field, tol=1e-06, max_count=100, print_out=True)[source]

Calibrate the membrane model to field conditions by finding the corresponding membrane service life std that matches the failure ratio in the field.

Parameters:

model_rawmodel instance

Model to be calibrated.

tint, float

Membrane age when membrane failure rate is surveyed [year].

membrane_failure_ratio_fieldfloat

Failure rate, e.g., 0.1 for 10%.

tolfloat, optional

Optimization tolerance, default is 1e-6.

max_countint, optional

Maximum iteration number for optimization, default is 100.

print_outbool, optional

If True, print out the model vs field comparison, default is True.

Returns:

membrane model object instance

Calibrated model.

membrane.membrane_age(t)[source]

Return the membrane age as the “resistance”.

Parameters:

tint or float

Membrane age.

Returns:

int or float

Membrane age.

Notes:

This function is a placeholder for more complex age input.

membrane.membrane_failure_year(model, year_lis, plot=True, amplify=30)[source]

Run the model over a list of time steps.

Parameters:

modelclass instance

Membrane_model class instance.

year_lislist, array-like

A list of time steps.

plotbool, optional

If True, plot the Pf, beta, R S distribution. Default is True.

amplifyint, optional

The arbitrary comparable size of the distribution curve. Default is 30.

Returns:

tuple

(pf list, beta list)

membrane.membrane_life(pars)[source]

Calculate the mean value of the service life from the manufacturer’s service life label (e.g., 30 years with 95% confidence) with the given standard deviation.

Parameters:

parsparameter object instance

Raw parameters. - pars.life_product_label_life - pars.life_confidence - pars.life_std

Returns:

float

Service life mean value.

membrane.pf_RS_special(R_info, S, R_distrib_type='normal', plot=False)[source]

Calculate the probability of failure given the resistance R and load S using three methods.

Parameters:
  • R_info (tuple) – distribution of Resistance, for this special case, the membrane service life. R_distrib_type=’normal’ -> tuple(m,s) for normal m: mean s: standard deviation other distribution form will be ignored.

  • S (numpy array) – distribution of load, for this special case, the membrane age.

  • R_distrib_type (str, optional) – by default ‘normal’

  • plot (bool, optional) – Whether to plot the distributions. Default is False.

Returns:

Probability of failure (Pf), beta factor, and R distribution

Return type:

tuple

Note

It is a special case of math_helper.Pf_RS, here the “load” S is a number and it calculates the probability of failure Pf = P(R-S<0), given the R(resistance) and S(load) with three three methods and use method 3 if it is checked “OK” with the other two

  1. crude monte carlo

  2. numerical integral of g kernel fit

  3. R S integral: \(F_R(S)\), reliability index(beta factor) is calculated with simple 1st order g.mean()/g.std()

R_info only supports the two-parameter normal distribution.

membrane.plot_RS_special(model, ax=None, t_offset=0, amplify=1)[source]

Plot R-S distribution vertically at a time to an axis (special case: S is a number).

Parameters:

modelmodel object instance

Model object instance containing the following attributes: - model.R_distrib: scipy.stats._continuous_distns, normal or beta distribution (calculated in pf_RS_special() through model.postproc()) - model.S: Single number for this special case

axaxes, optional

Subplot axis. If not provided, the current axis will be used.

t_offsetint or float, optional

Time offset to move the plot along the t-axis. Default is zero.

amplifyint, optional

Scale the height of the PDF plot.