function time_to_increase_temperature = calculate_time_to_increase_temperature( ...
rho_concrete, rho_air, k_concrete, k_air, ~, cp_concrete, ...
cp_air, T_initial, T_surface, L1, L2, L3, volume_P1_P3, ~, ...
Nx, Nt, delta_T, heat_power)
total_thickness = L1 + L2 + L3;
alpha_concrete = k_concrete / (rho_concrete * cp_concrete);
alpha_air = k_air / (rho_air * cp_air);
dx = total_thickness / Nx;
T = T_initial * ones(Nx, 1);
len_P1 = round(Nx * L1 / total_thickness);
len_P2 = round(Nx * L2 / total_thickness);
len_P3 = Nx - len_P1 - len_P2;
if len_P1 + len_P2 + len_P3 ~= Nx
len_P3 = Nx - len_P1 - len_P2;
material(1:len_P1) = alpha_concrete;
material(len_P1+1:len_P1+len_P2) = alpha_air;
material(len_P1+len_P2+1:Nx) = alpha_concrete;
time_to_increase_temperature = inf;
heat_input_per_point = heat_power * dt / (rho_concrete * cp_concrete * volume_P1_P3 / Nx);
T_new(i) = T(i) + material(i) * dt / dx^2 * (T(i+1) - 2*T(i) + T(i-1));
T_new(1) = T(1) + alpha_concrete * dt / dx^2 * (T(2) - T(1)) + heat_input_per_point * (T_surface - T(1));
if T(Nx) >= T_initial + delta_T
time_to_increase_temperature = time;
cp_concrete = 0.92 * 1000;
time_to_increase_temperature = calculate_time_to_increase_temperature( ...
rho_concrete, rho_air, k_concrete, k_air, [], cp_concrete, ...
cp_air, T_initial, T_surface, L1, L2, L3, volume_P1_P3, [], ...
Nx, Nt, delta_T, heat_power);
fprintf('Time to increase temperature by 1 K at the right side of P3: %.2f seconds\n', time_to_increase_temperature);
total_thickness = L1 + L2 + L3;
x = linspace(0, total_thickness, Nx);
y = linspace(0, time_to_increase_temperature, Nx);
plot(x, y, 'DisplayName', 'Time to Increase Temperature by 1 K');
title('Time to Increase Temperature by 1 K at the right side of P3');
main_process()
Time to increase temperature by 1 K at the right side of P3: Inf seconds