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

The limit state function for beam bending can be expressed as:

\[ \boldsymbol{R} = 80 \cdot \boldsymbol{F_y} \]

(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)

of_file.py

def nowak_collins_example(x, none_variable):
    """Objective function for the Nowak example (tutorial).
    """

    # Random variables
    f_y = x[0]
    p_load = x[1]
    w_load = x[2]
    capacity = 80 * f_y
    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)

from parepy_toolbox import sampling_algorithm_structural_analysis
from obj_function import nowak_collins_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, 
    }

var = [f, p, w]

# PAREpy setup
setup = {
             'number of samples': 70000, 
             'numerical model': {'model sampling': 'mcs'}, 
             'variables settings': var, 
             'number of state limit functions or constraints': 1, 
             'none variable': None,
             'objective function': nowak_collins_example,
             'name simulation': 'nowak_collins_example',
        }

# Call algorithm
results, pf, beta = sampling_algorithm_structural_analysis(setup)

Reference list