pystra.mc.MonteCarlo#

class MonteCarlo(analysis_options=None, limit_state=None, stochastic_model=None)[source]#

Bases: AnalysisObject

Monte Carlo Simulation

The preceding sections describe some methods for determining the reliability index \(\\beta\) for some common forms of the limit state function. However, it is sometimes extremely difficult or impossible to find \(\\beta\). [Nowak2000]

In this case, the probability of failure \(p_f\) may also be estimated by numerical simulation methods. A large variety of simulation techniques can be found in the literature, indeed, the most commonly used method is the Monte Carlo method. [Faber2009]

The principle of simulation methods is to carry out random sampling in the physical (or standardized) space. For each of the samples the limit state function is evaluated to figure out, whether the configuration is desired or undesired. The probability of failure \(p_f\) is estimated by the number of undesired configurations, respected to the total numbers of samples. [Lemaire2010]

Attributes:
  • analysis_option (AnalysisOption): Option for the structural analysis

  • limit_state (LimitState): Information about the limit state

  • stochastic_model (StochasticModel): Information about the model

Methods

computeBeta

Compute beta value

computeBins

Return an optimal amount of bins for a histogram

computeCoefficientOfVariation

Compute Coefficient of Variation

computeFailureProbability

Compute probability of failure

computeLimitState

Evaluate limit-state function

computePercentDone

Compute percent done

computeRandomNumbers

Compute random numbers

computeResults

Collect result of sampling

computeSumUpdate

Update summation

computeTransformation

Compute transformation from u to x space

getBeta

Returns the beta value

getBins

Returns the amount on bins

getDistributionData

Returns data for the failure

getFailure

Returns the probability of failure

init_run

Derived classes call this at top of their run()

setPoint

Set design point

setPoint(point=None)[source]#

Set design point

computeRandomNumbers()[source]#

Compute random numbers

computeTransformation()[source]#

Compute transformation from u to x space

Note

TODO: this method takes a lot of time, find some better solution.

computeLimitState()[source]#

Evaluate limit-state function

computeResults()[source]#

Collect result of sampling

computeSumUpdate()[source]#

Update summation

computeCoefficientOfVariation()[source]#

Compute Coefficient of Variation

computePercentDone()[source]#

Compute percent done

computeFailureProbability()[source]#

Compute probability of failure

computeBeta()[source]#

Compute beta value

computeBins(samples)[source]#

Return an optimal amount of bins for a histogram

Returns:
  • bins (int): Returns amount on bins

getBeta()[source]#

Returns the beta value

Returns:
  • beta (float): Returns the beta value

getFailure()[source]#

Returns the probability of failure

Returns:
  • Pf (float): Returns the probability of failure

getDistributionData()[source]#

Returns data for the failure

Returns:
  • all_G (float): Returns data from the distribution

getBins()[source]#

Returns the amount on bins

Returns:
  • bins (int): Returns the amount on bins (histogram)

init_run()#

Derived classes call this at top of their run()