kill(all)$

distillation :sensitvity  "Feed Composition",version 1.0,part 1
peter.vlasschaert@gmail.com,28/10/2020

load packages,option
=================

load(lrats)$ ratprint:false$

a)  material (=mass) balance.
======================
F=(F)eed
D=(D)istillate ( top       'column')
B =(B)oiler     (bottom  'column')

p1a:F=D+B;

b) material (= component) balance.
===========================
x = mole fraction  'liquid ' in the distillation column
y = mole fraction  'vapor' in the distillation column
z = mole fraction  'feed  '' in the distillation column

p1b:F*z=D*y + B*x;

→ find : D/F  

 => elimination  B

p2a:solve(p1a,B);

 => subst B into 'p1b'

p2b:lratsubst(p2a,p1b);

 => D/F

p2c:[D/F=w1];

p2ca:reverse(p2c[1]);

p2c1:lratsubst(p2c,p2b);

p2c2:solve([p2c1],w1)[1];

p2c3:lratsubst(p2ca,p2c2);

→ find : B/F  

 => elimination D

p3a:solve(p1a,D);

 => subst D into 'p1b'

p3b:lratsubst(p3a,p1b);

=> B/F

p3c:[B/F=w2];

p3ca:reverse(p3c[1]);

p3c1:lratsubst(p3ca,p3b);

p3c2:lratsubst(p3c,p3c1);

p3c3:solve([p3c2],w2)[1];

p3c4:lratsubst(p3ca,p3c3);

→ find : D/B 

use : 'p2c3 & p3c4'

p4:p2c3/p3c4;

→ sensitivity 'product composition' : D/F, B/F  => control  system 

a) rule : adjust  D/F & B/F , control 'x & y' for varation of z '= feed':differentation

p5a:'diff(lhs(p2c3),z) = diff(rhs(p2c3),z);

p5b:'diff(lhs(p3c4),z) = diff(rhs(p3c4),z);

p5b1:p5b*(-1);

info  : 0 ≤ x,y ≤ 1

b) relation .between 'p5a & p5b'

p5c:lhs(p5a) = lhs(p5b1);

info : absolute senstivity : 'p5c'

c)  differentation : D/B with respect  'z'

p5d:'diff(lhs(p4),z) = diff(rhs(p4),z);

info: 'diff(D/B,z,1) , because not very useful becauuse 'function,x,y,z'

→ relative change : relative sensitivity

 =>  part : a

p6a:p5a/lhs(p2c3);

p6a1:lhs(p6a)=lratsubst([p2c3],rhs(p6a));

result 1 : z-x →0, z=x → use p2c3, pratical  : z-x ,'very small'

p6a2:limit(lhs(p2c3),z,x)=limit(rhs(p2c3),z,x);

 =>  part : b

p6b:p5b1/lhs(p3c4);

p6b1:lhs(p6b)=lratsubst([p3c4],rhs(p6b));

 => compositions  y & x as function  of z ,use D/F,B/F

use :'p2c3 & p3c4'

p6ca:lhs(solve(p2c3,y)[1])=expand(rhs(solve(p2c3,y)[1]));
p6ca1:'diff(y,z)=diff(rhs(p6ca),z);
p6cb:lhs(solve(p3c4,x)[1])=expand(rhs(solve(p3c4,x)[1]));
p6cb1:'diff(x,z)=diff(rhs(p6cb),z);

rem : 'diff(y,z,1),'diff(x,z,1), no meaning 
→ varation z , D/F or B/F  affect both y & x @  the same time.