summaryrefslogtreecommitdiff
path: root/914/CH2/EX2.12/ex2_12.sce
blob: 015b4962349d71628a33acbc9c051406e3395f6c (plain)
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
clc;
warning('off');
printf("\n\n example2.12 - pg52");
// given
T=53+273.15;  //[K] - temperature
mu1=1.91*10^-5;
mu2=2.10*10^-5;
T1=313.15;  //[K] - temperature 
T2=347.15;  //[K] - temperature
// for air
// using linear interpolation of the values in table 2.2
function b=f(a)
    b=log(mu1/a)/log(T1);
endfunction
function y=g(a)
    y=log(mu2)-log(a)-f(a)*log(T2);
endfunction
a1=10^-7;
A=fsolve(a1,g);
B=f(A);
// using the formula ln(mu)=lnA+Bln(t)
mu=%e^(log(A)+B*log(T))*10^3;  //[cP]
printf("\n\n the viscosity of air at %fdegC is %fcP",T-273.15,mu);
// similarly for water
BdivR=1646;
A=3.336*10^-8;
mu=A*%e^(BdivR/T)*10^5 //[cP]
printf("\n\n the viscosity of water at %fdegC is %fcP",T-273.15,mu);