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
Compute beta value
Return an optimal amount of bins for a histogram
Compute Coefficient of Variation
Compute probability of failure
Evaluate limit-state function
Compute percent done
Compute random numbers
Collect result of sampling
Update summation
Compute transformation from u to x space
Returns the beta value
Returns the amount on bins
Returns data for the failure
Returns the probability of failure
Derived classes call this at top of their run()
Set design point
- computeTransformation()[source]#
Compute transformation from u to x space
Note
TODO: this method takes a lot of time, find some better solution.
- computeBins(samples)[source]#
Return an optimal amount of bins for a histogram
- Returns:
bins (int): Returns amount on bins
- 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()