# Homework 2 - ' J = &amp;quot;K !Ttemp !x Ttemp ( x ,t + !t...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ' J = "K !Ttemp !x Ttemp ( x ,t + !t ) " Ttemp ( x ,t ) !t ' dTtemp %K dx % =& J x A = J x + !x A + A!x (K dTtemp dx x Ttemp ( x ,t + !t ) ( Ttemp ( x ,t ) !t x + !x !x \$ " " # !Ttemp !t =K ! 2Ttemp !x 2 t = 0, Ttemp ( x,0) = f ( x ) = TB t > 0, Ttemp (0,t) = TW TB = 37C TW = 44C For a nonhomogeneous problem, As t 0! x!L Ttemp ( L, t ) = Tw ! a steady state temperature distribution v(x) will be reached v' ' ( x) = 0 for 0<x<L v(0) = Tw v ( L ) = Tw v( x) = (Tw ! Tw ) x + Tw = Tw L Ttemp ( x, t ) = v( x) + w( x, t ) k (v + w) xx = (v + w) t v xx = 0 vt = 0 kwxx = wt w(0, t ) = Ttemp (0, t ) ! v(0) = Tw ! Tw = 0 w( L, t ) = Ttemp ( L, t ) ! v( L) = Tw ! Tw = 0 w( x,0) = Ttemp ( x,0) ! v( x) = f ( x) ! v( x) = f ( x) ! Tw w( x, t ) = X ( x)T (t ) X ( x)T !(t ) = kX !!( x)T (t ) X ##( x) T #(t ) = = "! 2 X ( x) kT (t ) X !!( x) + "2 X = 0 T ! + "# 2T = 0 X = c1 cos(!x) + c 2 sin(!x) T = c3e #!" t 2 X (0) = c1 cos(! (0)) + c 2 sin(! (0)) = c1 = 0 X ( L) = c 2 sin(!L) = 0 "= " n! L #k ( n \$nx 2 ) t L ... ! w( x, t ) = ! An e n =1 sin( \$nx ) L w( x,0) = " An sin( n =1 # \$nx ) = f ( x) ! v( x) L 2 n#x An = ! [ f ( x) " v( x)]sin( )dx L0 L Ttemp ( x, t ) = v( x) + w( x, t ) L Ttemp ( x, t ) = Tw + ! An e n =1 " #k ( n\$x 2 ) t L sin( n\$x ) L 2 n#x An = ! [TB " TW ] sin( )dx L0 L L v' ' ( x) = 0 for 0<x<L v(0) = Tw L v ( ) = TB 2 v( x) = (Tw ! TB ) x + Tw L 2 0! x! L 2 t = 0, Ttemp ( x,0) = f ( x ) = TB t > 0, Ttemp (0,t) = TW L Ttemp ( , t ) = TB 2 Ttemp ( x, t ) = v( x) + w( x, t ) w(0, t ) = Ttemp (0, t ) ! v(0) = Tw ! Tw = 0 L L L w( , t ) = Ttemp ( , t ) ! v( ) = TB ! TB = 0 2 2 2 w( x,0) = Ttemp ( x,0) ! v( x) = f ( x) ! v( x) w( x, t ) = X ( x)T (t ) X ( x)T !(t ) = kX !!( x)T (t ) X ##( x) T #(t ) = = "! 2 X ( x) kT (t ) X !!( x) + "2 X = 0 T ! + "# 2T = 0 X = c1 cos(!x) + c 2 sin(!x) T = c3e #!" t 2 X (0) = c1 cos(! (0)) + c 2 sin(! (0)) = c1 = 0 L L X ( ) = c 2 sin(! ) = 0 2 2 "= " 2n! L #k ( n 2\$nx 2 ) t L ... ! w( x, t ) = ! An e n =1 sin( 2\$nx ) L w( x,0) = " An sin( n =1 # \$nx ) = f ( x) ! v( x) L An = 4 2n#x ! [ f ( x) " v( x)]sin( L )dx L0 L 2 Ttemp ( x, t ) = v( x) + w( x, t ) " #k ( 2x Ttemp ( x, t ) = (TB # TW ) + TW + ! An e L n =1 2\$nx 2 ) t L sin( 2\$nx ) L An = 4 2x 2n#x [TB " (TB " TW ) " TW ] sin( )dx L! L L 0 L 2 ....................................................................................... Ttemp ( n ) = An e #" ( 2!nx 2 ) t L cos( 2!nx ) L " #% ( n 2\$nx 2 ) t L ... ! Ttemp ( x, t ) = ! Ttemp ( n ) =! An e n =1 n =1 " cos( 2\$nx ) L Ttemp ( x,0) = f ( x) = TB = ! An cos( n =1 " 2#nx ) L n=m & # \$1 L' 2(nx 2 \$ 1 4'nx ! L !0 % cos( L ) "dx \$ 2 x + 8'n sin( L )! = 2 & # \$ ! \$ !0 L % " L An = 2 L 2"nx !0 f ( x) cos( L )dx L n!x 2 ) t L 2 \$ , L 2!nx ) #" ( Ttemp ( x, t ) = % * & f ( x) cos( )dx 'e L n =1 + 0 L ( cos( 2!nx ) L %HW4 function HW4 clear, clc L=1.8; alpha=0.4; space_steps=50; dx=L/space_steps; time_steps=15; dt=1.5/time_steps; u=zeros(space_steps,time_steps); u(1:space_steps+1,1)=37; syms tt x for n=1:1:15 f(n)= (37/44) * exp( (-alpha)*((n*2*pi/L)^2) * tt ); end sumf=sum(f); tt=0; for t=1:time_steps+1 tt=tt+dt; x=0; for i=2:space_steps x=x+dx; u(i,t+1)=-1/0.12 * eval(sum(f)); % Constant f(x) end end % IC xx=[0:dx:L]; u(:,1) = 37; u(:, 2:size(u,2)) = u(:, 2:size(u,2)) + 44; % BC figure, plot(xx,u(:,1), xx,u(:,ceil(0.1/dt)+1), xx,u(:,ceil(0.2/dt)+1),... xx,u(:,ceil(0.3/dt)+1), xx,u(:,ceil(0.5/dt)+1),... xx,u(:,ceil(1/dt)+1),xx,u(:,ceil(1.5/dt)+1) ) axis tight; grid on; title('One-dimensional unsteady-state diffusion') xlabel('Finger thickness, X'); ylabel('Temperature, T') figure, plot(xx,u(:,1), xx,u(:,ceil(0.1/dt)+1), xx,u(:,ceil(0.2/dt)+1),... xx,u(:,ceil(0.3/dt)+1), xx,u(:,ceil(0.5/dt)+1),... xx,u(:,ceil(1/dt)+1),xx,u(:,ceil(1.5/dt)+1) ) axis tight; grid on; title('One-dimensional unsteady-state diffusion') xlim([1.780 1.8]); ylim([36.9 44.1]); xlabel('Finger thickness, X'); ylabel('Temperature, T') figure, plot(xx,u(:,1), xx,u(:,ceil(0.1/dt)+1), xx,u(:,ceil(0.2/dt)+1),... xx,u(:,ceil(0.3/dt)+1), xx,u(:,ceil(0.5/dt)+1),... xx,u(:,ceil(1/dt)+1),xx,u(:,ceil(1.5/dt)+1) ) axis tight; grid on; title('One-dimensional unsteady-state diffusion') xlim([0.605 1.01]); ylim([36.9 44.1]); xlabel('Finger thickness, X'); ylabel('Temperature, T') ...
View Full Document

## This note was uploaded on 04/17/2008 for the course BMED 2200 taught by Professor Robertspilker during the Spring '08 term at Rensselaer Polytechnic Institute.

Ask a homework question - tutors are online