www.gusucode.com > pde 案例源码 matlab代码程序 > pde/ResultsFromATimeDependentProblemExample.m

    %% Results from a Time-Dependent Problem
% Obtain a solution from a parabolic problem.
%%
% The problem models heat flow in a solid.
model = createpde();
importGeometry(model,'Tetrahedron.stl');
pdegplot(model,'FaceLabels','on','FaceAlpha',0.5)
view(45,45)
%%
% Set the temperature on face 2 to 100. Leave the other boundary conditions
% at their default values (insulating).
applyBoundaryCondition(model,'dirichlet','face',2,'u',100);
%%
% Set the coefficients to model a parabolic problem with 0 initial
% temperature.
d = 1;
c = 1;
a = 0;
f = 0;
u0 = 0;
%%
% Create a mesh and solve the PDE for times from 0 through 200 in steps of
% 10.
tlist = 0:10:200;
generateMesh(model);
u = parabolic(u0,tlist,model,c,a,f,d);
%%
% Create a |TimeDependentResults| object from the solution.
results = createPDEResults(model,u,tlist,'time-dependent');
%%
% Plot the solution on the surface of the geometry at time 100.
pdeplot3D(model,'ColorMapData',results.NodalSolution(:,11))