Physics Assignment | MATLAB Code

Verified

Added on  2022/08/11

|5
|416
|28
AI Summary
Semi-infinite medium initially at Ti=0 oC.At surface x = 0, the temperature was suddenly increased to 100 oC.What is the time taken for x = 45 cm to reach 50oC? Material is Gold and ? =127 x 10^-6 m^2/s you need to find the time =? You need to use Matlab to solve 1.Find the time of heat transfer based on the given information 2.What are boundary conditions? 3.Plot a graph demonstrating the temperature profile of depth (or distance) with time You need to solve for the Gold material only The instructor upload a video for the programing and we made the code but he said we have to add a few thing about 2 coding line and we must find the time from the graph , not from the equations . I will upload the question and our coding . If you could check our code and try to resolve it

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: Physics
PHYSICS
Name of the Student
Name of the University
Author Note

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1PHYSICS
MATLAB code:
L = 0.45; %wall thickness
n = 10; %number of simulation nodes
T0 = 0; %deg C, initial temperature of wall
T1s = 100; %deg C, surface 1 temperature
Tx = 50; %deg C, distance x temperature
dx = L/n; %m, node thickness
alpha = 127*10^-6; %thermal diffusivity
t_final = 63; %s, simulation time
dt= 0.1; %s, fixed time step
x = 0:dx:L-dx/2;
T = ones(n,1)*T0;
Document Page
2PHYSICS
dTdt = zeros(n,1);
t = 0:dt:t_final;
time = t(1);
for j = 1:length(t)
for i = 2:n-1
dTdt(i) = alpha*(-(T(i)-T(i-1))/dx^2+(T(i+1)-T(i))/dx^2);
end
dTdt(1)= alpha*(-(T(1)-T1s)/dx^2+(T(2)-T(1))/dx^2);
dTdt(n)= alpha*(-(T(n)-T(n-1))/dx^2+(Tx-T(n))/dx^2);
T = T+dTdt*dt;
if(x==0.45)AND(T==50)
Td=T;
break
end
figure(1)
plot(x,T, 'Linewidth', 3)
axis([0 L 0 50])
xlabel('Distance (m)')
ylabel('Temperature (\circC)')
Document Page
3PHYSICS
pause(0.001)
time = t(1) + dt;
end
fprintf('time taken for x=45 cm to reach 50 degree C is %d sec \n',time)
Output:
time taken for x=45 cm to reach 50 degree C is 63 sec
Temperature with distance graph:
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45
Distance (m)
0
5
10
15
20
25
30
35
40
45
50
Temperature ( °C)

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4PHYSICS
Boundary conditions:
Initial temperature is 0 degree C.
So, T(0) = 0 C for all x
At x= 0 T(0) = 100 degree C. (as temperature suddenly increased to 100 degree C)
Tend = 45 degree C.
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]