Código em MATLAB 5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

% Monte Carlo Simulation for Reliability of Reinforced Concrete Beam in Fire

Situation

% Define constants and parameters

b = 20; % Width of the beam (cm)

h = 50; % Height of the beam (cm)

L = 5; % Length of the beam (m)

fc = 25; % Compressive strength of concrete (MPa)

fy = 500; % Yield strength of steel (MPa)

specific_weight = 25; % Specific weight (kN/m³)

% Load ratios

rc = [0.25, 0.5, 0.75];

% Time of exposure to fire (minutes)

time_exposure = [20, 30, 60, 90, 120];

% Number of Monte Carlo simulations

num_simulations = 100000;

% Progress bar setup

f = waitbar(0, 'Simulation Progress');

% Define cases

cases = [3.2, 0, 4.5, 4.0;

3.2, 0, 3.5, 2.5;

5.0, 0, 4.5, 3.9;

5.0, 0, 3.5, 2.9;

8.0, 0, 4.5, 3.7;

8.0, 0, 3.5, 2.7;

9.45, 0, 4.5, 3.5;

9.45, 0, 3.5, 2.5];

% Standard and parametrized fire temperatures (Tables 4 and 5)


standard_fire_temperatures = [781.35, 841.8, 945.34, 1006, 1049];

parametrized_fire_temperatures = [787.6921309, 840.976228, 643.1779957,


345.3716959, 47.56539623];

% Alpha values for standard and parametrized fires (Tables 2 and 3)

alpha_standard = [2.7, 2.85, 1.78, 1.15, 0.81;

2.41, 2.25, 1.2, 0.735, 0.515;

5.3, 3.9, 1.9, 1.148, 0.8;

4.5, 2.9, 1.25, 0.75, 0.511;

1.95, 2.35, 1.85, 1.215, 0.861;

2.12, 2.17, 1.21, 0.76, 0.525;

1.65, 1.86, 1.3, 0.9, 0.675;

8.45, 5.6, 1.85, 0.96, 0.62];

alpha_parametrized = [16.2, 8.8, 19.6, 10.67, 7.17;

11.5, 5.8, 20.1, 10.96, 7.32;

15.3, 8, 17.8, 10.52, 7.09;

11.2, 5.4, 17.8, 10.85, 7.25;

1.92, 2.35, 2.1, 8.3, 6.5;

2.1, 2.15, 2.5, 10.4, 7.45;

1.62, 1.87, 1.52, 5.9, 5.15;

8, 5.8, 20.8, 11.85, 8.1];

% PL and LL values for each case and load ratio (Table 7)

PL_LL_values = [15.64, 1.04, 15.24, 3.05, 14.15, 8.49;

15.64, 1.04, 15.24, 3.05, 14.15, 8.49;

23.94, 1.60, 23.32, 4.66, 21.66, 12.99;

23.94, 1.60, 23.32, 4.66, 21.66, 12.99;

37.71, 2.51, 36.74, 7.35, 34.11, 20.47;

37.71, 2.51, 36.74, 7.35, 34.11, 20.47;

43.53, 2.90, 42.42, 8.48, 39.39, 23.63;

43.53, 2.90, 42.42, 8.48, 39.39, 23.63];

% Loop over each case


for case_num = 1:size(cases, 1)

As = cases(case_num, 1);

A_s = cases(case_num, 2);

s = cases(case_num, 3);

d_prime = cases(case_num, 4);

d = h - d_prime;

% Initialize arrays to store reliability indices and failure


probabilities

reliability_indices = zeros(length(rc), length(time_exposure), 2); % 2


for standard and parametrized fire

failure_probabilities = zeros(length(rc), length(time_exposure), 2);

% Loop over load ratios

for rc_idx = 1:length(rc)

% Get PL and LL values for the current case and load ratio

PL = PL_LL_values(case_num, rc_idx * 2 - 1);

LL = PL_LL_values(case_num, rc_idx * 2);

% Loop over time of exposure to fire

for time_idx = 1:length(time_exposure)

% Loop over fire types (1 = standard, 2 = parametrized)

for fire_type = 1:2

% Initialize counter for number of failures

num_failures = 0;

% Perform Monte Carlo simulations

for sim = 1:num_simulations

% Generate random variables for the simulation

random_As = normrnd(As, 0.02 * As);

random_fy = lognrnd(1.16 * fy, 0.07 * (1.16 * fy));

random_h = normrnd(h, 0.04 * h);

random_fc = lognrnd(1.23 * fc, 0.15 * (1.23 * fc));

random_b = normrnd(b, 0.04 * b);

random_d_prime = lognrnd(d_prime, 0.1 * d_prime);


random_theta_R = lognrnd(1.1, 1.1 * 0.1);

random_theta_S = lognrnd(1, 0.1);

random_MPL = normrnd((PL * L^2)/8, 0.1 * ((PL * L^2)/8));

random_MLL = gamrnd((0.2 * (LL * L^2)/8)/(0.95/((0.2 *


(LL * L^2)/8)^0.5)), )/(0.95/((0.2 * (LL * L^2)/8)^0.5))); % Shape parameter
k=5 for mean=0.2*MLL

% Calculate temperature-dependent properties

if fire_type == 1

Tr = standard_fire_temperatures(time_idx);

alpha_r = alpha_standard(case_num, time_idx);

else

Tr = parametrized_fire_temperatures(time_idx);

alpha_r = alpha_parametrized(case_num, time_idx);

end

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

r = max(min(r, 1), 0); % Ensure 0 <= r <= 1

fyTr = random_fy * r;

t = time_exposure(time_idx) / 60; % Convert time to hours

nw = 1 - 0.0616 * t^-0.88;

nx = 0.18 * log(alpha_r * t / s^2) - 0.81;

ny = nx; % Assuming nx = ny for simplicity

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

x_500 = sqrt((alpha_r * t) / exp(4.5 + 4800 / (0.18 * nw


* Tr)));

b_Tc = random_b - 2 * x_500;

% Calculate resistant moment (Mn_T) and soliciting moment


(MS_fi) based on random variables

a_Tc = random_As * fyTr / (0.85 * random_fc * b_Tc);

Mn_T = random_theta_R * (random_As * fyTr * random_h – 2


* random_d_prime + random_As * fyTr * ((random_h - random_d_prime) - a_Tc /
2));

MS_fi = random_theta_S * (random_MPL + random_MLL);


% Check if the beam fails

if Mn_T < MS_fi

num_failures = num_failures + 1;

end

end

% Calculate reliability index and failure probability

reliability_indices(rc_idx, time_idx, fire_type) = norminv(1


- num_failures / num_simulations);

failure_probabilities(rc_idx, time_idx, fire_type) =


num_failures / num_simulations;

end

end

end

% Update progress bar

waitbar(case_num / size(cases, 1), f, sprintf('Simulation Progress: Case


%d/%d', case_num, size(cases, 1)));

% Plot reliability indices and failure probabilities for the current case

figure;

subplot(2, 1, 1);

hold on;

for fire_type = 1:2

plot(time_exposure, squeeze(reliability_indices(:, :, fire_type)), '-


o', 'LineWidth', 2);

end

xlabel('Time of Exposure to Fire (minutes)');

ylabel('Reliability Index');

title(sprintf('Reliability Indices for Case %d', case_num));

legend(arrayfun(@(x) sprintf('rc = %.2f', x), rc, 'UniformOutput',


false));

grid on;

hold off;

subplot(2, 1, 2);
hold on;

for fire_type = 1:2

plot(time_exposure, squeeze(failure_probabilities(:, :, fire_type)),


'-o', 'LineWidth', 2);

end

xlabel('Time of Exposure to Fire (minutes)');

ylabel('Failure Probability');

title(sprintf('Failure Probabilities for Case %d', case_num));

legend(arrayfun(@(x) sprintf('rc = %.2f', x), rc, 'UniformOutput',


false));

grid on;

hold off;

end

% Close progress bar

close(f);

You might also like