Example 1 - CRUDE MONTE CARLO
Consider the simply supported beam show in example 5.1 Nowak and Collins [1]. The beam is subjected to a concentrated live load \(p\) and a uniformly distributed dead load \(w\). Assume \(\boldsymbol{P}\) (concentrated live load), \(\boldsymbol{W}\) (uniformly distributed dead load) and the yield stress, \(\boldsymbol{F_y}\), are random quantities; the length \(l\) and the plastic setion modulus \(z\) are assumed to be precisely know (deterministic). The distribution parameters for \(\boldsymbol{P}, \boldsymbol{W}\) and \(\boldsymbol{F_y}\) are given bellow:
Variable | Distribution | Mean | Coefficient of Variation (COV) |
---|---|---|---|
Yield stress \(\left(\boldsymbol{F_y}\right)\) | Normal | 40.3 | 0.115 |
Live load¹ \(\left(\boldsymbol{P}\right)\) | Gumbel max. | 10.2 | 0.110 |
Dead load \(\left(\boldsymbol{W}\right)\) | Log-normal | 0.25 | 0.100 |
¹Stochastic random variable |
The limit state function for beam bending can be expressed as:
\[ \boldsymbol{R} = 80 \cdot \boldsymbol{F_y} \cdot D\] | (1) |
\[ \boldsymbol{S} = 54 \cdot \boldsymbol{P} + 5832 \cdot \boldsymbol{W} \] | (2) |
\[ \boldsymbol{G} = \boldsymbol{R} - \boldsymbol{S} \begin{cases} \leq 0 & \text{failure}\\ > 0 & \text{safe} \end{cases} \] | (3) |
Consider equation (4) for resistance degradation \(\left(D\right)\) [2]. Use 50 years to stochastic analysis (five time steps).
\[ D(t_i) = 1 - \frac{0.2}{t_i} \cdot 0.01 \] | (4) |
of_file.py
def nowak_collins_time_example(x, none_variable):
"""Objective function for the Nowak example (tutorial).
"""
# User must copy and paste this code in time reliability objective function
###########################################
id_analysis = int(x[-1])
time_step = none_variable['time analysis']
t_i = time_step[id_analysis]
# t_i is a time value from your list of times entered in the 'none variable' key.
###########################################
# Random variables
f_y = x[0]
p_load = x[1]
w_load = x[2]
# Degradation criteria
if t_i == 0:
degrad = 1
else:
degrad = 1 - (0.2 / t_i) * 1E-2
# Capacity and demand
capacity = 80 * f_y * degrad
demand = 54 * p_load + 5832 * w_load
# State limit function
constraint = capacity - demand
return [capacity], [demand], [constraint]
your_problem.ipynb
# Libraries
import pandas as pd
pd.set_option('display.max_columns', None)
import numpy as np
from parepy_toolbox import sampling_algorithm_structural_analysis
from obj_function import nowak_collins_time_example
# Dataset
f = {'type': 'normal',
'parameters': {'mean': 40.3, 'sigma': 4.64},
'stochastic variable': False,
}
p = {'type': 'gumbel max',
'parameters': {'mean': 10.2, 'sigma': 1.12},
'stochastic variable': False,
}
w = {'type': 'lognormal',
'parameters': {'mean': 0.25, 'sigma': 0.025},
'stochastic variable': False,
}
# PAREpy setup
setup = {
'number of samples': 70000,
'numerical model': {'model sampling': 'mcs-time', 'time steps': 5},
'variables settings': var,
'number of state limit functions or constraints': 1,
'none variable': {'time analysis': list(np.linspace(0, 50, num=5, endpoint=True))},
'objective function': nowak_collins_time_example,
'name simulation': 'nowak_collins_time_example',
}
# Call algorithm
results, pf, beta = sampling_algorithm_structural_analysis(setup)