MATLAB: How to define a time dependent boundary heat source using the Partial Differential Equation (PDE) Toolbox

boundarycreatepdeheat sourcepdethermaltime-dependenttransient

Dear Community,
Is it possible define a time dependent thermal boundary heat source, which is only active at a defined moment of time ? So that I can analyze afterwards the heat diffusion over time.
t = 0; q = 200000; t > 0s; q = 0;
My code:
thermalmodel = createpde('thermal','transient');
%Import and plot the block geometry.
importGeometry(thermalmodel,'****.stl');
(...)
thermalProperties(thermalmodel,'ThermalConductivity',k, ...
'SpecificHeat',cp, ...
'MassDensity',rho);
Fs = 100;
tlist = 0:1/Fs:100;
T0 = 300;
thermalIC(thermalmodel,T0);
thermalBC(thermalmodel,'Face',5,...
'HeatFlux',@externalHeatFlux,'Vectorized','on');
result = solve(thermalmodel,tlist);
T = result.Temperature;
function Qflux = externalHeatFlux(region,state)
if t = tlist(1,1) % t = 0
Qflux = q;
else
Qflux = 0;
end
end
Many thanks in advance.

Best Answer

I think, but am not 100% sure, that the question makes no sense as posed. An instantaneous flux will not cause any change in the heat. You need to define a (short) time over which the flux is active. I believe that the situation is like this recent Answer, which has a bit of detail on what to do.
Alan Weiss
MATLAB mathematical toolbox documentation