Tutorial09 - City University of Hong Kong Electronic...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: City University of Hong Kong Electronic Engineering Semester B 2007-2008 EE3108 Engineering Analysis Tutorial 9 The cooling a copper rod is investigated using the heat equation. The rod is uniformed heated to 100°C before t =0. It is then put into contact with two cold objects at 0 °C. The problem is very similar to that in the lecture notes, but the boundary conditions are changed. The implicit method for solving the partial differential equation (PDE) is considered as follows. where Q(x,t) is again the temperature in Celsius and D = 1.16 cm2/s is the heat diffusion constant of copper. ∂Q ∂ 2Q =D 2 , ∂t ∂x t=0 x Cold contact L/2 t>0 t= 0 Hot Cooling −L/2 Cold contact The boundary conditions are modified as: Q x=± L / 2 = 0 . The initial condition is Q( x,0) = 100 for −L/2< x <L/2. The length L is 10 cm. We are again interested in the time window from t = 0 to T, where T=10 s. The time axis is discretized into N−1 = 5000 steps and the length axis is discretized into M−1 = 100 steps so that: tn = (n − 1)∆t ∆t = T /( N − 1) xm = (m − 1)∆x − L / 2 ∆x = L /( M − 1) m Qn = Q( xm , tn ) for n = 1, 2, …, N and m = 1, 2, …, M. EE 3108 Semster B 2007/2008 8 Equilibrium T9-1 S C Chan I. Propagation From the lecture notes, the difference equation is: m m m m Qn = −bQn ++1 + (1 + 2b)Qn − bQn +−1 1 1 where b = D∆t /( ∆x ) . However, for m = 1 and M, the equations have to be modified to fit the boundary conditions. How? 2 In matrix notation, write down the propagation from n to n+1: T9-2 II. Matlab Modify the file below to implement the simulation. %File: t0902 clear; L=10; T=10; M=101; N=5001; dx=L/(M-1); dt=T/(N-1); x=((1:M)-1)*dx-L/2; t=((1:N)-1)*dt; D=1.16; %Initialize the input at t=0 Q=zeros(M,N); %Find the propagation matrix S b=D*dt/(dx^2) S=zeros(M,M); for r=1:M if r==1 elseif r==M else end end %Propagate in time for n=1:N-1 end %Plot mesh(t,x,Q); T9-3 T9-4 ...
View Full Document

Page1 / 4

Tutorial09 - City University of Hong Kong Electronic...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online