4_Quarterman_Patrick_HW08A - %Arrange Temperature for each...

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

View Full Document Right Arrow Icon
Patrick Quarterman Section 4, HW08A Script: %Script 'Water_Drop' %Patrick Quarterman, Section 4 HW08A %Calculates temperature of water drop for time 0 to 10 seconds %Given information p=1000; %desnity of water (kg/m^3) c=4200; %specific heat of water (J/(kg*K)) h=500; %heat convection coefficient (W/(m^2*K)) %Drop information Ti=[50 35 40]; %initial temp in Celsius Tf=[-10 -15 -20]; %final temp in Celsius r=[1*10^-3 1.9*10^-3 1.5*10^-3]; %drop radius in meters %time interval t=0:.2:10; %time interval in seconds %Calculate temperature for each drop over time interval T1=Tf(1)+(Ti(1)-Tf(1)).*exp(-(3*h/(p*r(1)*c)).*t); T2=Tf(2)+(Ti(2)-Tf(2)).*exp(-(3*h/(p*r(2)*c)).*t); T3=Tf(3)+(Ti(3)-Tf(3)).*exp(-(3*h/(p*r(3)*c)).*t);
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %Arrange Temperature for each drop over time into array T=[T1;T2;T3] %temperature for drops at t=3 seconds position = find(t==3); %find column location for t=3s time_three = T(:,position) %display temp for t=3 s [rows,columns]= find(T<0 & T>-1) %find when t freezes time_freeze= t(columns) %display time of freezing %Plot Temp vs. Time x=t; y1=T1; y2=T2; y3=T3; plot(x,y1, 'r' ,x,y2, 'g' ,x,y3) xlabel( 'Time s' ) ylabel( 'Temperature C' ) title( 'Temperature vs. Time' ) grid on 1 2 3 4 5 6 7 8 9 10-20-10 10 20 30 40 50 Time s Temperature C Temperature vs. Time Matlab Commands: #4- drop 1 at t= 5.2 s, drop 2 at 6.6, drop 3 at 4.8 s...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

4_Quarterman_Patrick_HW08A - %Arrange Temperature for each...

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

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