blob: 969aa707f75b15c32c42a0e3d5db0f1ea2c28324 (
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
|
clear;
clc;
printf("Example 10.6\n");
//Diffusivity of CO2 in ethanol
D=4D-9; //in m^2/s
t=100; //Time in sec
//Solving all the integral as defined in the proces
//as per described in the book
//a useful result is obtained
Cai=poly([0],'x');
y=[0 10^-3];
for i=1:2
mole(i)=((2*sqrt(D*t/%pi)*exp(-y(i)^2/(4*D*t)))-(y(i)*erfc(y(i)/(2*sqrt(D*t)))));
end
ret=(mole(1)-mole(2))/mole(1);
printf("\nProportion retained is %.1f %%\n",ret*100);
//End
|