MATH-4500 Spring 2023PDEs of Math/Phys Problem Set 5 D.W. SchwendemanNotes1. DUE DATE: Monday, March 20, by 10am (start of class).2. Please show all work for the problems. Illegible or...

1 answer below »

View more »
Answered 4 days AfterMar 15, 2023

Answer To: MATH-4500 Spring 2023PDEs of Math/Phys Problem Set 5 D.W. SchwendemanNotes1. DUE DATE: Monday,...

Banasree answered on Mar 20 2023
42 Votes
3.a. Ans.
Code:
    % Define the region and create a PDE model
model = createpde();
% Define the geometry of the region
% Example: a unit cube centered at the origin
x = [-0.5,0.5,0.5,-0.
5,-0.5,0.5,0.5,-0.5];
y = [-0.5,-0.5,0.5,0.5,-0.5,-0.5,0.5,0.5];
z = [-0.5,-0.5,-0.5,-0.5,0.5,0.5,0.5,0.5];
g = geometryFromMesh(triangulation([1,2,3;1,3,4;1,2,6;1,5,6;1,4,5;2,3,8;2,7,8;3,4,8;5,6,7;5,7,8],[x;y;z]'));
% Set the thermal diffusivity
k = 1;
% Define the heat source as a function of x, y, and z
Q = @(x,y,z) 1;
% Define the initial temperature as a function of x, y, and z
f = @(x,y,z) 0;
% Define the boundary conditions
% Example: heat flux g(x,y,z) = 1 on the entire boundary
g = @(x,y,z,u,time) 1;
applyBoundaryCondition(model,'neumann','face',1:model.Geometry.NumFaces,'g',g);
% Set the PDE coefficients and initial conditions
specifyCoefficients(model,'m',0,'d',1,'c',k,'a',0,'f',Q);
setInitialConditions(model,f);
% Define the time range and solve the PDE
tlist = linspace(0,1,100);
result = solvepde(model,tlist);
% Compute the total thermal energy in the region over time
V = integral3(@(x,y,z) 1,g.Geometry.XLimits(1),g.Geometry.XLimits(2),g.Geometry.YLimits(1),g.Geometry.YLimits(2),g.Geometry.ZLimits(1),g.Geometry.ZLimits(2));
E = sum(result.NodalSolution(:))*V;
% Compute d/dt [E(t)]
dEdt = zeros(1,length(tlist));
for i = 2:length(tlist)
dEdt(i) = (E(i)-E(i-1))/(tlist(i)-tlist(i-1));
end
% Plot the solution at selected times
figure;
for i = 1:5:length(tlist)
pdeplot3D(model,'ColorMapData',result.NodalSolution(:,i),'FaceAlpha',0.5);
title(sprintf('Temperature distribution at t = %.2f',tlist(i)));
drawnow;
end
% Plot d/dt [E(t)]
figure;
plot(tlist,dEdt);
title('Rate of change of total thermal energy');
xlabel('Time');
ylabel('dE/dt');
b)Ans.
For a steady-state solution, the temperature distribution u(x) should not...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here
April
January
February
March
April
May
June
July
August
September
October
November
December
2025
2025
2026
2027
SunMonTueWedThuFriSat
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30