0% found this document useful (0 votes)
17 views6 pages

Código em MATLAB 4

The document defines parameters for a Monte Carlo simulation of beam reliability under fire conditions. It initializes arrays to store results for different exposure times, cases, load ratios, and fire types (standard, parametric). The simulation loops over these variables, performing simulations to calculate reliability indices and failure probabilities for each combination. Results are plotted showing the effects of load ratio and fire type on reliability and failure probability for each case.

Uploaded by

SOST HUMAP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views6 pages

Código em MATLAB 4

The document defines parameters for a Monte Carlo simulation of beam reliability under fire conditions. It initializes arrays to store results for different exposure times, cases, load ratios, and fire types (standard, parametric). The simulation loops over these variables, performing simulations to calculate reliability indices and failure probabilities for each combination. Results are plotted showing the effects of load ratio and fire type on reliability and failure probability for each case.

Uploaded by

SOST HUMAP
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

function main

% Define simulation parameters

num_simulations = 100000; % Number of Monte Carlo simulations

L = 5; % Beam span (m)

gamma_g = 1.4; % Partial safety factor for permanent loads

gamma_q = 1.4; % Partial safety factor for variable loads

exposure_times = [20, 30, 60, 90, 120]; % Exposure times in minutes

load_ratios = [0.25, 0.5, 0.75]; % Load ratios

compartment = struct('floor_width', 10, 'floor_length', 15, 'floor_area', 150, 'ceiling_area',


150, 'wall_area', [60, 60, 40, 40], 'num_doors', 2, 'door_width', 1, 'num_windows', 12,
'window_width', 1.5, 'thermal_inertia_floor_ceiling', 2034, 'thermal_inertia_walls', 1521); %
Compartment characteristics

cases = [32, 0.032, 45, 40; 32, 0.032, 35, 30; 50, 0.050, 45, 39; 50, 0.050, 35, 29; 80, 0.080,
45, 37; 80, 0.080, 35, 27; 94.5, 0.095, 45, 35; 94.5, 0.095, 35, 25]; % Cases: [As (cm^2), rho (%),
d' (cm), c1 (cm)]

alpha_r_standard = [27, 241, 53, 45, 195, 212, 165, 845; 285, 225, 39, 29, 235, 217, 186, 56;
178, 12, 19, 125, 185, 121, 13, 185; 115, 0735, 1148, 075, 1215, 076, 09, 096; 081, 0515, 08,
0511, 0861, 0525, 0675, 062]; % Thermal diffusivity ratio values for standard fire

alpha_r_parametric = [162, 115, 153, 112, 192, 21, 162, 8; 88, 58, 8, 54, 235, 215, 187, 58;
196, 201, 178, 178, 21, 25, 152, 208; 1067, 1096, 1052, 1085, 83, 104, 59, 1185; 717, 732, 709,
725, 65, 745, 515, 81]; % Thermal diffusivity ratio values for parametric fire

% Initialize arrays for results

reliability_indices = zeros(length(exposure_times), length(cases), length(load_ratios), 2); %


Last dimension for fire types (1: standard, 2: parametric)

probabilities_of_failure = zeros(length(exposure_times), length(cases), length(load_ratios),


2); % Last dimension for fire types

% Loop over exposure times, cases, and load ratios

for t = 1:length(exposure_times)

for c = 1:length(cases)

for r = 1:length(load_ratios)

% Perform Monte Carlo simulation for standard fire

[reliability_index_std, probability_of_failure_std] =
monte_carlo_simulation(num_simulations, exposure_times(t), cases(c,:), load_ratios(r),
'standard', alpha_r_standard(t, c), compartment, L, gamma_g, gamma_q);
reliability_indices(t, c, r, 1) = reliability_index_std;

probabilities_of_failure(t, c, r, 1) = probability_of_failure_std;

% Perform Monte Carlo simulation for parametric fire

[reliability_index_param, probability_of_failure_param] =
monte_carlo_simulation(num_simulations, exposure_times(t), cases(c,:), load_ratios(r),
'parametric', alpha_r_parametric(t, c), compartment, L, gamma_g, gamma_q);

reliability_indices(t, c, r, 2) = reliability_index_param;

probabilities_of_failure(t, c, r, 2) = probability_of_failure_param;

end

end

end

% Plot results

plotthe results

plot_results(exposure_times, reliability_indices, probabilities_of_failure, load_ratios, cases);

end

function [reliability_index, probability_of_failure] = monte_carlo_simulation(num_simulations,


exposure_time, case_params, load_ratio, fire_type, alpha_r, compartment, L, gamma_g,
gamma_q)

% Initialize variables for Monte Carlo simulation

failure_count = 0;

M_Rd = [156.4; 152.4; 239.4; 233.2; 377.1; 367.4; 435.3; 424.2]; % Design resistant moments
(M_Rd) for each case (kNm)

% Loop over the number of simulations

for i = 1:num_simulations

% Generate random samples for the random variables

As = normrnd(case_params(1), case_params(1) * 0.02); % Reinforcement area

fy = lognrnd(log(1.16 * 500) - 0.5 * (0.07)^2, 0.07); % Steel yield stress

d = normrnd(50, 50 * 0.004); % Beam height

fc = lognrnd(log(1.23 * 25) - 0.5 * (0.15)^2, 0.15); % Concrete strength


alpha = normrnd(0.417e-6, 0.417e-6 * 0.06); % Thermal diffusivity

b = normrnd(20, 20 * 0.004); % Beam width

d_prime = lognrnd(log(case_params(3)), log(case_params(3)) * 0.1); % Cover

theta_R = lognrnd(log(1.10) - 0.5 * (0.1)^2, 0.1); % Uncertainty in resistance model

% Calculate temperatures and other parameters

[Tr, Tc] = calculate_temperatures(exposure_time, alpha * alpha_r, fire_type, case_params,


compartment);

x500 = sqrt((alpha * alpha_r * exposure_time * 60) / exp(4.5 + 480 / (0.18 * (1 - 0.0616 *


(exposure_time * 60)^(-0.88)) * Tc)));

b_Tc = b - 2 * x500;

r = (720 - (Tr + 20)) / 470;

r = min(max(r, 0), 1);

fyTr = fy * r;

aTc = (As * fyTr) / (0.85 * fc * b_Tc);

MnT = theta_R * As * fyTr * (d - d_prime) + (As - As) * fyTr * (d - aTc)^2 / 2;

mu_LL = (8 / L^2) * M_Rd(i) / ((5 * (1 - load_ratio) / (load_ratio * gamma_g) + gamma_q /


0.2));

mu_PL = mu_LL * (5 * (1 - load_ratio) / (load_ratio));

MPL = normrnd(mu_PL, mu_PL * 0.1);

MLL = gamrnd(2, 0.5 * mu_LL);

theta_S = lognrnd(0, 0.1);

MS = theta_S * (MPL + MLL);

gX = MnT - MS;

% Check for failure

if gX <= 0

failure_count = failure_count + 1;

end

end

% Calculate the probability of failure and reliability index


probability_of_failure = failure_count / num_simulations;

reliability_index = -norminv(probability_of_failure);

end

function [Tr, Tc] = calculate_temperatures(exposure_time, alpha, fire_type, case_params,


compartment)

% Convert exposure time to hours for the Wickstrom model

t = exposure_time / 60;

% Calculate the gas temperature (Tg) based on the fire type

if strcmp(fire_type, 'standard')

Tg = 20 + 345 * log10(8 * t + 1); % Standard fire curve (ISO 834)

else

% Parametric fire curve

time_temperature = [20, 821; 30, 840; 60, 639; 90, 333; 100, 224; 120, 20];

Tg = interp1(time_temperature(:, 1), time_temperature(:, 2), exposure_time, 'linear',


'extrap');

end

% Calculate the temperature of the steel reinforcement (Tr) andconcrete (Tc) using
Wickstrom's model

s = case_params(3); % Distance from the steel bar axis to the concrete face (d')

nw = 1 - 0.0616 * t^(-0.88);

nss = 0.18 * log(alpha * t / s^2) - 0.81;

nx = ny = nss; % Assuming symmetrical heating

Tr = nw * (nx + ny - 2 * nx * ny) + nx * ny * Tg;

Tc = Tg;

end

function plot_results(exposure_times, reliability_indices, probabilities_of_failure, load_ratios,


cases)

% Plot reliability indices and probabilities of failure for each case and load ratio
for c = 1:length(cases)

for r = 1:length(load_ratios)

for f = 1:2 % Fire types (1: standard, 2: parametric)

fire_type = 'Standard';

if f == 2

fire_type = 'Parametric';

end

% Plot reliability indices for all load ratios and fire types in one graph

figure;

hold on;

for r = 1:length(load_ratios)

for f = 1:2 % Fire types (1: standard, 2: parametric)

if f == 1

fire_type = 'Standard';

line_style = '-';

else

fire_type = 'Parametric';

line_style = '--';

end

plot(exposure_times, squeeze(reliability_indices(:, c, r, f)), line_style, 'DisplayName',


['Load Ratio ' num2str(load_ratios(r)) ' ' fire_type ' Fire']);

end

end

title(['Reliability Index for Case ' num2str(c)]);

xlabel('Exposure Time (min)');

ylabel('Reliability Index');

legend('show');

% Plot probabilities of failure for all load ratios and fire types in one graph

figure;

hold on;

for r = 1:length(load_ratios)
for f = 1:2 % Fire types

if f == 1

fire_type = 'Standard';

line_style = '-';

else

fire_type = 'Parametric';

line_style = '--';

end

plot(exposure_times, squeeze(probabilities_of_failure(:, c, r, f)), line_style, 'DisplayName',


['Load Ratio ' num2str(load_ratios(r)) ' ' fire_type ' Fire']);

end

end

title(['Probability of Failure for Case ' num2str(c)]);

xlabel('Exposure Time (min)');

ylabel('Probability of Failure');

legend('show');

end

end

end

end

You might also like