mmc1.doc - Spiral - Imperial College London

Solvent recycle with imperfect membranes:
A semi-continuous workaround for diafiltration
(Supplementary Material)
Marc Schaepertoens 1 , Christos Didaskalou 2 , Jeong F. Kim 1 , Andrew G.
Livingston 1 , *, Gyorgy Szekely 2 , *
1
Department of Chemical Engineering, Imperial College London, South Kensington Campus,
London, SW7 2AZ, United Kingdom
2
School of Chemical Engineering & Analytical Science, The University of Manchester, The Mill,
Sackville Street, Manchester M13 9PL, United Kingdom
* Corresponding authors:
+44 (0)20 7594 5582, [email protected];
+44 (0)161 306 4366, [email protected]
Contents
1.
Start-up procedure, washing of the system and control ........................................................ 2
2.
Practical implementation of the mathematical model ............................................................ 4
2.1
Mathematical problem statement ...................................................................................... 4
2.2
MATLAB implementation of the analytical solution...................................................... 5
2.3
MATLAB Code (analytical solution) ................................................................................. 7
3.
Derivations of steady state mass distribution ........................................................................ 16
4.
Washing of the solvent recovery stage ................................................................................... 19
5.
HPLC method ............................................................................................................................. 19
6.
On the selection of stage membrane areas ............................................................................. 20
7.
Screening data ............................................................................................................................ 23
8.
Further discussion: ..................................................................................................................... 24
8.1
9.
Maximum selectivity in a two-stage cascade with recycle........................................... 24
Tabulated data of the diafiltration results .............................................................................. 26
1. Start-up procedure, washing of the system and control
At the start of each diafiltration the system is filled with fresh solvent. The system is started up by
introducing a concentrated solute mixture into the feed tank and recirculating the mixture between
the feed tank and stage 1 retentate loop with a fully open retentate valve V1 and thus no permeate
flow from the 1st stage (F1) as the system is not yet pressurised.
Once the system has equilibrated (CT1,i = C1,i), the back-pressure regulators V1 and V2 are tightened
in tandem to their set pressures while maintaining approximately equal transmembrane pressures
in stage 1 and stage 2. Due to the much higher flowrate through V1, the pressure in stage 1 reaches
the pressure set point much faster and it is usually convenient to leave V2 tightened to
approximately the correct pressure from a prior washing run with pure solvent.
An alternative way of starting up is to set the system to the correct flowrates with a pure solvent
system, and to then introduce the solutes as a concentrated mixture into the feed tank at t = 0. This
will of course mean that stage 1 is not physically well-mixed at t=0 but under certain conditions e.g.
small feed tank volume and high pressurising HPLC flowrate with very high interchange between
the feed tank and stage 1 volume, as is desired anyway, this may be negligible. This method of
starting up is usually more convenient in a lab setting as the recycle ratio does not have to be
checked immediately after start-up, and the user can rest assured that the recycle ratio is at the
correct set point at start-up.
It should be noted that the pressures of each stage cannot be controlled independently for a given
recycle ratio, r21. The control strategy is therefore as follows:
1. Use V1 to set stage 1 pressure so that, for the appropriate recycle ratio (in this case r21 = 0.5),
we obtain the desired and approximately equal transmembrane pressures in stage 1 and
stage 2, and the desired transmembrane pressure through stage 3 – the stage 1 pressure is a
value that should be pre-calculated based on the permeance values of each membrane and
the areas of the membrane should be chosen accordingly.
Therefore, it is convenient to choose the following:

Use the same membrane in the separation stages so that the permeance values are
equal, B1 = B2.

1
Choose the membrane area of stage 1, A1, to be (1−𝑟 ) times the membrane area of
21
stage 2, A2.

Note that this neglects effects from concentration polarisation and osmotic pressure.
Because stage 1 will be more concentrated than stage 2, in a system where these
effects are significant, A1 may need to be sized accordingly larger.
2. Use V2 to adjust the stage 2 pressure to balance the flows F2 and F4 to obtain the correct
recycle ratio. In our case, for r21 = 0.5, we want to equalise these two flows. Note that whilst
the recycle ratio is defined by the ratio of flows F2 and F1, it is much easier in a laboratory
setting to measure and back-calculate from F4 instead of F1 as F4 is at atmospheric pressure.
3. The flow through the solvent recovery unit (stage 3) is thereby already fixed, and we should
choose the membrane area of the solvent recovery stage, A3, accordingly so we obtain the
desired stage 3 transmembrane pressure.
The system can be washed using the 4-way valves in each loop in conjunction with the recirculation
pumps and the permeate lines between stages have to be washed separately by re-pressurising the
system with pure solvent. During washing under pressure, it is sensible to lead the stage 1 and
stage 2 back-pressure lines as well as the stage 3 permeate line into a separate washing tank and
draw the HPLC pump input from a fresh solvent tank to wash the system in a one-way direction.
2.
Practical implementation of the mathematical model
2.1 Mathematical problem statement
The system can be described in its generic form by the following system of equations:
𝑑𝑥
= (𝑎1 𝑥 + 𝑎2 𝑦 + 𝑎3 𝑧)
𝑑𝑡
𝑑𝑦
= (𝑎4 𝑥 + 𝑎5 𝑦 + 𝑎6 𝑧)
𝑑𝑡
𝑑𝑧
= ( 𝑎7 𝑥 + 𝑎8 𝑦 + 𝑎9 𝑧 )
𝑑𝑡
or in matrix notation as follows:
𝛼11
𝑥̇
𝛼
(𝑦̇ ) = ( 21
𝛼31
𝑧̇
𝛼12
𝛼22
𝛼32
𝛼13 𝑥
𝛼23 ) (𝑦)
𝛼33 𝑧
(𝜉̇ ) = (𝑀)(𝜉)
We therefore have a system, (𝜉̇ ) = (𝑀)(𝜉), with initial conditions 𝜉(0) = 𝐴.
If the coefficient matrix M is diagonalizable, then there is a change of basis matrix P so that
𝜆1
𝑃−1 𝑀𝑃 = 𝐷 = ( 0
0
0
𝜆2
0
0
0)
𝜆3
So let us rewrite our original system as follows:
(𝜉̇ ) = 𝑀 (𝜉)
(𝑃 𝑁̇) = 𝑀 (𝑃 𝑁)
Thus (after change of basis),
𝑁̇ = 𝑃−1 𝑀 𝑃 𝑁
𝑁̇ = 𝐷 𝑁
or
𝑁̇1
𝜆1
̇
(𝑁2 ) = ( 0
0
𝑁̇3
0
𝜆2
0
0
𝑁1
0 ) (𝑁2 )
𝜆3 𝑁3
(𝑁̇) = (𝐷)(𝑁)
The solution to this differential system is now much simpler due to the diagonal coefficient matrix:
𝑁(𝑡) = 𝑒 𝐷𝑡 𝑁(0)
where 𝑁(0) is the vector describing the initial conditions for the system after change of basis. It relates to
the original system – we know that
𝜉(0) = 𝐴
so it follows that (by the same change in basis),
𝑃 𝑁(0) = 𝐴
𝑁(0) = 𝑃−1 𝐴
And so
𝑁(𝑡) = 𝑒 𝐷𝑡 (𝑃−1 𝐴)
But we are interested in the solution to our original system and need to therefore revert the change in
basis so that
𝜉(𝑡) = 𝑃 𝑒 𝐷𝑡 (𝑃−1 𝐴)
where 𝜉(𝑡) describes our set of equations, P is the change of basis matrix composed of the eigenvectors
and D is a diagonal matrix composed of the eigenvalues of the initial system.
2.2 MATLAB implementation of the analytical solution
The full MATLAB code for derivation of generic analytical solution for the system herein comprising two
separation stages and one solvent recovery stage as well as the specific solution to our system is available
in the Supporting Information. Amongst other outputs, the code will yield a matrix ‘fsave’ describing the
concentrations of each component in each stage for each relevant diafiltration operation interval
parameterised with time as well as a numerical approximation thereof, ‘vpa_fsave’.
The numerical approximations of these functions in vpa_save are the model curves in the main text
figures. We are intending to publish a similar script using an ode45 solver implementation for
completeness with the reviewed text but that is much less useful for plotting figures as functions cannot
be included as real parameterised functions but must be input with all data points and thus necessarily
also lead to resolution loss when zooming in.
However, an ODE solver implementation of some sorts will almost certainly need to employed with a
system where rejections are not assumed constant and concentration polarization is taken into account.
A general idea in pseudo-code of the key part is given here.
For ‘N’ diafiltration intervals, lasting ‘time’ hours each (‘N’ and ‘time’ correspond to the parameters used
in the real MATLAB code below), a pseudo code for execution of such a process (separate diafiltration
intervals with washing of the solvent recovery stage) would look as follows:
% Concentrations, Cs,i(t) can be solved as functions of the starting
concentrations, Cs,i(t=0) and time, t, by solving Error! Reference source
not found. - Error! Reference source not found. either analytically as
described in the supporting information or by using an ODE solver
𝐶𝑠,𝑖 (𝑡) = 𝑓(𝐶𝑠,𝑖 (0), 𝑡)
% Define starting concentrations at the very start, i.e. end of the “0th
interval”
𝐶1,𝑖 (0)
𝐶𝑠,𝑖 (𝑒𝑛𝑑){0} = (𝐶2,𝑖 (0)) =
𝐶3,𝑖 (0)
𝑀0𝑖
)
𝑉1
0
( 0 )
(
% Start loop for N diafiltration intervals
for n = 1:1:N
% Call initial conditions from previous interval, i.e. from the start
/ 0th interval
𝐶𝑠,𝑖 (0){𝑛} = 𝐶𝑠,𝑖 (𝑒𝑛𝑑){𝑛 − 1}
% Solve for final concentrations, Cs,i(t=time) as functions of the
starting concentrations, Cs,i(t=0) and time, t, by solving Error!
Reference source not found. - Error! Reference source not found.
analytically as described in the supporting information or using an
ODE solver
𝑠𝑜𝑙𝑣𝑒 𝐶𝑠,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛} = 𝑓(𝐶𝑠,𝑖 (0){𝑛}, 𝑡 = 𝑡𝑖𝑚𝑒)
𝐶1,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛}
(𝑡
𝐶𝑠,𝑖 = 𝑡𝑖𝑚𝑒){𝑛} = (𝐶2,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛})
𝐶3,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛}
% Save the final conditions of this diafiltration interval for
further processing e.g. checking mass balance later on
𝑠𝑎𝑣𝑒 𝐶𝑠,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛}
% Wash the solvent recovery stage, i.e. reset the solute
concentrations in the 3rd stage to zero while leaving the components
of Cs,i(t=time)(n) that do not relate to the 3rd stage untouched
𝑠𝑒𝑡 𝐶𝑠,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛}[𝐶3,𝑖 ] = 0, 𝑝𝑟𝑒𝑠𝑒𝑟𝑣𝑒 𝐶𝑠,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛}[𝐶1,𝑖 , 𝐶2,𝑖 ]
𝐶1,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛}
𝐶𝑠,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛} = (𝐶2,𝑖 (𝑡 = 𝑡𝑖𝑚𝑒){𝑛})
0
% Reset time parameter, t, to zero for the next diafiltration
interval
𝑐𝑙𝑒𝑎𝑟 𝑡
% Restart loop for the next diafiltration interval until n = N
end
The actual MATLAB code implementation is fully published below and is equivalent to the MATLAB file
published with the supporting information. It outputs the same MATLAB figure files that are also
attached to the SI.
2.3 MATLAB Code (analytical solution)
%% reset MATLAB
clear
% clears variables and functions from memory
close all hidden
% closes all windows including hidden windows
clc
% clears the command window and homes the cursor
% %{
%% set output format
format short
%% define symbolic constants
% we advise working with definitions of permeation e.g. Pij = (1 - Rij)
% instead of rejections e.g. Rij so simplify the code and reduce the number
% of characters
syms V V1 V2 V3 r21 Ca1_t0 Ca2_t0 Ca3_t0 Pa1 Pa2 Pa3 Pb1 Pb2 Pb3
%% define system of equations describing 3 stage system
a11
a12
a13
a21
a22
a23
a31
a32
a33
=
=
=
=
=
=
=
=
=
-(V/V1)*(1/(1-r21))*(Pa1);
(V/V1)*(r21/(1-r21));
(V/V1)*(Pa3);
(V/V2)*(1/(1-r21))*(Pa1);
-(V/V2)*((r21/(1-r21))+(Pa2));
0;
0;
(V/V3)*(Pa2);
-(V/V3)*(Pa3);
% coefficient matrix, M
Ma = [ a11, a12, a13;
a21, a22, a23;
a31, a32, a33;];
b11
b12
b13
b21
b22
b23
b31
b32
b33
=
=
=
=
=
=
=
=
=
-(V/V1)*(1/(1-r21))*(Pb1);
(V/V1)*(r21/(1-r21));
(V/V1)*(Pb3);
(V/V2)*(1/(1-r21))*(Pb1);
-(V/V2)*((r21/(1-r21))+(Pb2));
0;
0;
(V/V3)*(Pb2);
-(V/V3)*(Pb3);
% coefficient matrix, M
Mb = [ b11, b12, b13;
b21, b22, b23;
b31, b32, b33;];
[P,D] = eig(Ma);
% P is the change of basis matrix comprising the eigenvectors of the system
% as column vectors concatenated along the second (row) dimension
% D is the diagonalised form of the coefficient matrix, M, after change of
% basis with matrix P as defined by D = P^-1.M.P ; the diagonal elements of
% D are the eigenvalues of the system
% consult help eig in MATLAB console for more information
% column vector the initial conditions of the system of equations before change of basis
A = [Ca1_t0;
Ca2_t0;
Ca3_t0];
C = P\A;
%{
Mathematically equivalent but worse computationally with regards to
execution time and numerical accuracy (for numerical values)
Q = inv(P)
C = Q*A
%}
t = sym('t');
N = [ C(1)*exp(D(1,1)*t);
C(2)*exp(D(2,2)*t);
C(3)*exp(D(3,3)*t);];
f_a = P*N;
f_a = simplify(f_a);
% duplicate system of equations for component b with similar parameters
% except for 3 different permeation values and 3 different initial values
syms Pb1 Pb2 Pb3 Cb1_t0 Cb2_t0 Cb3_t0
f_b = subs(f_a, [Pa1, Pa2, Pa3, Ca1_t0, Ca2_t0, Ca3_t0], [Pb1, Pb2, Pb3, Cb1_t0, Cb2_t0,
Cb3_t0]);
% can use symvar(f_a) and symvar(f_b) to check successful subs
% combine the two sets of three equations for each component and reorganise
% vector so that rows describe Ca1, Cb1, Ca2, Cb2, Ca3, Cb3 in that order
% (instead of Ca1, Ca2, Ca3, Cb1, Cb2, Cb3)
f_all = cat(1,f_a,f_b);
f_all([1,2,3,4,5,6],:) = f_all([1,4,2,5,3,6],:)
% f_all is the function with all constants still in symbolic form
%% define constants as global variables and assign values
% V1, V2, V3 are volumes of stage 1, 2, 3 respectively
% Rin is rejection of compound i in stage n for i={a,b} and n={1,2,3}
% V is feed flowrate i.e. flowrate from stage 2 to stage 3 which is also equal to flowrate
from stage 3 to stage 1.
% r21 is recycle ratio from stage 2 back to stage 1
% assign values
% constant system
V = 0.3;
%
V1 = 0.200;
%
V2 = 0.070;
%
V3 = 0.055;
%
r21 = 0.500;
%
parameters, volume & recycle ratio
[L.h-1]
[L]
[L]
[L]
[]
% rejection parameters, product
Ra1 = 0.981;
% []
Ra2 = Ra1;
% []
Ra3 = 0.995;
% []
Pa1 = (1-Ra1);
Pa2 = (1-Ra2);
Pa3 = (1-Ra3);
% []
% []
% []
% rejection parameters, impurity
Rb1 = 0.549;
% []
Rb2 = Rb1;
% []
Rb3 = 0.984;
% []
Pb1 = (1-Rb1);
Pb2 = (1-Rb2);
Pb3 = (1-Rb3);
% []
% []
% []
f_t = subs(f_all)
% f_t is a function with all constants except the initial conditions
% combined into numerical coefficients; thus
% f_t = f(t, Ca1_t0 Ca2_t0 Ca3_t0, Cb1_t0 Cb2_t0 Cb3_t0)
% check using symvar(f_t);
% time is the running time per diafiltration operation (before washing, if applicable i.e. not
total running time)
% N is the number of consecutive diafiltrations i.e. (number of washes + 1)
time = 8;
% [h]
N = 3;
% []
%% set initial conditions
% CiN_t0 is concentration of compound i in stage n at t = 0
Ca1_t0
Cb1_t0
Ca2_t0
Cb2_t0
Ca3_t0
Cb3_t0
=
=
=
=
=
=
1;
1;
0;
0;
0;
0;
%
%
%
%
%
%
[g.L-1]
[g.L-1]
[g.L-1]
[g.L-1]
[g.L-1]
[g.L-1]
% preallocate cell arrays
CiN_t0{N+1} = [];
CiN_t0_copy{N+1} = [];
fsave{N} = [];
f{N} = [];
% define initial conditions
CiN_t0{1} = [Ca1_t0; Cb1_t0; Ca2_t0; Cb2_t0; Ca3_t0; Cb3_t0];
CiN_t0_copy{1} = CiN_t0{1};
%% calculation
for n = 1:1:N
Ca1_t0
Cb1_t0
Ca2_t0
Cb2_t0
Ca3_t0
Cb3_t0
=
=
=
=
=
=
CiN_t0{n}(1,1);
CiN_t0{n}(2,1);
CiN_t0{n}(3,1);
CiN_t0{n}(4,1);
CiN_t0{n}(5,1);
CiN_t0{n}(6,1);
%
%
%
%
%
%
[g.L-1]
[g.L-1]
[g.L-1]
[g.L-1]
[g.L-1]
[g.L-1]
fsave{n} = subs(f_t);
t = time;
f{n} = subs(f_t);
% set initial condition for next loop iteration as final condition of
% current loop iteration
CiN_t0{n+1} = f{n};
% create copy of CiN_t0 before overwriting stage 3 concentrations; this
% will be useful for mass balances and other functions where we need to
% backtrack how much mass was removed from stage 3 with each washing step
CiN_t0_copy{n+1} = CiN_t0{n+1};
% wash solvent recovery stage i.e. set Ci3 to 0 for i={a,b}
CiN_t0{n+1}([5, 6]) = 0;
clear t
end
% f gives a matrix of column vectors with the numerical values of Ca1, Cb1,
% Ca2, Cb2, Ca3, Cb3 at the end (!) of each diafiltration operation before
% washing the solvent
f = cat(2,f{:})
% CiN_t0 gives a matrix of column vectors with the numerical values of Ca1, Cb1,
% Ca2, Cb2, Ca3, Cb3 before the start (!) of each diafiltration operation,
CiN_t0 = cat(2,CiN_t0{:})
% fsave gives a matrix of column vectors describing the values of the concentrations Ca1, Cb1,
Ca2, Cb2, Ca3, Cb3
% as functions of time t for the relevant intevals i.e. for each
% diafiltration operation; fsave therefore describes the set of curves
% modelling each diafiltration operation in the main body of the
% publication
fsave = cat(2,fsave{:})
% %}
% Stage 3 Permeate A
f_t(7,:) = f_t(5,:).*(1-Ra3);
% Stage 3 Permeate B
f_t(8,:) = f_t(6,:).*(1-Rb3);
% Yield of A
f_t(9,:) = (V1*f_t(1,:)+V2*f_t(3,:))./(V1*CiN_t0_copy{1}(1)+V2*CiN_t0_copy{1}(3));
% Yield of B (not really necessary but may be useful for some calculations e.g. impurity
removal fraction is (1 - 'Yield of B'))
f_t(10,:) = (V1*f_t(2,:)+V2*f_t(4,:))./(V1*CiN_t0_copy{1}(2)+V2*CiN_t0_copy{1}(4));
% Purity of A
f_t(11,:) =
(V1.*f_t(1,:)+V2.*f_t(3,:))./(V1.*f_t(1,:)+V2.*f_t(3,:)+V1.*f_t(2,:)+V2.*f_t(4,:));
% Purity of B (not really necessary but may be useful for some calculations)
f_t(12,:) = (V1*f_t(2,:)+V2*f_t(4,:))./(V1*f_t(1,:)+V2*f_t(3,:)+V1*f_t(2,:)+V2*f_t(4,:));
% Removal of A (not really necessary but may be useful for some calculations)
f_t(13,:) = 1-f_t(9,:);
% Removal of B (not really necessary but may be useful for some calculations)
f_t(14,:) = 1-f_t(10,:);
% dCa1/dt
f_t(15,:) = a11*f_t(1,:) + a12*f_t(3,:) + a13*f_t(5,:);
% dCb1/dt
f_t(16,:) = b11*f_t(2,:) + b12*f_t(4,:) + b13*f_t(6,:);
% dCa2/dt
f_t(17,:) = a21*f_t(1,:) + a22*f_t(3,:) + a23*f_t(5,:);
% dCb2/dt
f_t(18,:) = b21*f_t(2,:) + b22*f_t(4,:) + b23*f_t(6,:);
% dCa3/dt
f_t(19,:) = a31*f_t(1,:) + a32*f_t(3,:) + a33*f_t(5,:);
% dCb3/dt
f_t(20,:) = b31*f_t(2,:) + b32*f_t(4,:) + b33*f_t(6,:);
% dPa/dt
f_t(21,:) = ((V1.*f_t(13,:) + V2.*f_t(15,:)).*((V1.*f_t(1,:) + V2.*f_t(3,:)) + (V1.*f_t(2,:) +
V2.*f_t(4,:))) - ((V1.*f_t(13,:) + V2.*f_t(15,:)) + (V1.*f_t(14,:) +
V2.*f_t(16,:))).*(V1.*f_t(1,:) + V2.*f_t(3,:))) ./ (((V1.*f_t(1,:) + V2.*f_t(3,:)) +
(V1.*f_t(2,:) + V2.*f_t(4,:))).^2)
% dPb/dt
f_t(22,:) = ((V1.*f_t(14,:) + V2.*f_t(16,:)).*((V1.*f_t(1,:) + V2.*f_t(3,:)) + (V1.*f_t(2,:) +
V2.*f_t(4,:))) - ((V1.*f_t(13,:) + V2.*f_t(15,:)) + (V1.*f_t(14,:) +
V2.*f_t(16,:))).*(V1.*f_t(2,:) + V2.*f_t(4,:))) ./ (((V1.*f_t(1,:) + V2.*f_t(3,:)) +
(V1.*f_t(2,:) + V2.*f_t(4,:))).^2)
f_t = simplify(f_t)
%% Further modification for plotting: We need to sub in the CiN values and get N columns (N=3
in this case) x 22 rows for each stage of the 3x8 hrs diafiltration.
% The functions contained in f_t from and including row 7 onwards are all
% functions of the concentrations (Ca1, Cb1,
% Ca2, Cb2, Ca3, Cb3) as defined in rows 1-6 which in turn are functions of
% the initial concentrations for the respective diafiltration interval
% (Ca1_t0 Ca2_t0 Ca3_t0, Cb1_t0 Cb2_t0 Cb3_t0) and time
% In other words, f_t = f(t, Ca1_t0 Ca2_t0 Ca3_t0, Cb1_t0 Cb2_t0 Cb3_t0)
% but because some functions were added to f_t after the symbolic constants
% (V V1 V2 V3 r21 Pa1 Pa2 Pa3 Pb1 Pb2 Pb3) had been
% substituted by their constant values, we first need to repeat that
% substitution but without substituting the initial values and time points of the last
% diafiltration interval
% Therefore, clear t and all concentrations but retain CiN_t0 so we can
% reinitialise the system
clear t Ca* Cb*
% Repeat substitution of symbolic variables (V V1 V2 V3 r21 Pa1 Pa2 Pa3 Pb1
% Pb2 Pb3) for rows 7 onwards; note that rows 1-6 were substituted much
% earlier.
% It would also be possible to define the entire function vector before
% running the diafiltration interval calculations but that would make the
% code further above a lot messier, we prefer to keep this separate i.e.
% first calculate the dependent variables (CiN) and then define secondary
% parameters (Yield, Purity, etc.) separately
f_t = subs(f_t)
% symvar can be used to confirm that f_t is now defined as
% f_t = f(t, Ca1_t0 Ca2_t0 Ca3_t0, Cb1_t0 Cb2_t0 Cb3_t0)
symvar(f_t)
% We now need to expand fsave, the matrix describing the concentrations as
% functions of time with the additional rows in f_t (rows 7 onwards) and replace the
% initial concentrations in each column of f_t with those corresponding to the correct
interval
% e.g. for the first column, which describes the diafiltration interval
% between 0 - 8 hours ((N-1)*time to N*time for N=1) by the initial conditions at time 0 ((N1)*time for N=1), and for the
% second column describing the diafiltration interval from 8-16 hours ((N-1)*time to N*time
for N=2), we
% need to substitute the initial conditions at 8 hours ((N-1)*time for N=2), and so on.
%
%
%
%
These initial conditions at each interval were saved in CiN_t0 for
this purpose
CiN_t0 would give the initial conditions before the washing of the
solvent recovery stage but those are not the ones we need here
% First let's replicate rows 7 onwards into N columns and add those to
% fsave. Actually, this is probably unnecessary as the first 6 rows of f_t
% should become the same as the first 6 rows of fsave after correct
% substitution of the initial values .. but hey, it looks like a cool line
% of code and I just looked up the repmat command so let's make this worth
% it
fsave = cat(1,fsave,repmat(f_t(7:end,:),1,3))
% so after substition fsave should be equal to f_t so we could have also
% probably just used
% fsave = f_t
% There is probably a computationally more efficient way of doing this in
% MATLAB with indexing but let's use a for loop
for n = 1:1:N
% call correct initial concentrations for each interval
Ca1_t0 = CiN_t0(1,n)
Cb1_t0 = CiN_t0(2,n)
Ca2_t0 = CiN_t0(3,n)
Cb2_t0 = CiN_t0(4,n)
Ca3_t0 = CiN_t0(5,n)
Cb3_t0 = CiN_t0(6,n)
fsave(:,n) = subs(fsave(:,n))
end
%
%
%
%
%
%
%
%
%
%
%
%
There is another thing that we need to do to plot these curves in origin.
Each of these columns now describes an interval but the t value in each
of these curves refers to the range of time from 0 to time but we need
the first column to refer to the interval from 0 - 8 hours ((N-1)*time to
N*time for N=1) but the second interval needs to refer to 8 - 16 hours
((N-1)*time to N*time for N=2).
So when the x values (describing the progress of the diafiltration/time)
go from 8 - 16 ((N-1)*time to N*time for N=2) for the second
diafiltration interval/ second curve we need (t) replaced by (t-8) so the
curve is shifted correctly.
we could do this in the same for loop above but let's do it separately to
keep track
syms t
for n = 1:1:N
% call correct initial concentrations for each interval
fsave(:,n) = subs(fsave(:,n),t,t-(n-1)*time)
end
vpa_fsave = vpa(fsave,8)
% vpa_fsave is a numerical approximation that can be used for function definitions in plotting
% programs such as OriginPro; an approximation to less than 8 decimal digit
% accuracy is probably sufficient
%% Plot figures
%% Plot figure 1
fig1 = figure();
figure1data{1} = xlsread('matlab_expdata.xlsx','30');
figure1data{2} = xlsread('matlab_expdata.xlsx','46');
xmin = 0;
xmax = 16;
% Subplot 1 (top-left): Stage 1 Retentate
fig1a = subplot(2,2,1);
hold on
ymin = 0;
ymax = 1.02*1;
fig1a_C1ce1 = scatter(figure1data{1}(:,1),figure1data{1}(:,17));
set(fig1a_C1ce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig1a_C1ce2 = scatter(figure1data{2}(:,1),figure1data{2}(:,17));
set(fig1a_C1ce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig1a_C1cat1 = scatter(figure1data{1}(:,1),figure1data{1}(:,18));
set(fig1a_C1cat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[0.5 0 0.5])
fig1a_C1cat2 = scatter(figure1data{2}(:,1),figure1data{2}(:,18));
set(fig1a_C1cat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 1])
fig1a_C1ce_model = ezplot(fsave(1,1),[xmin, xmax]);
set(fig1a_C1ce_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig1a_C1cat_model = ezplot(fsave(2,1),[xmin, xmax]);
set(fig1a_C1cat_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('Concentration / g.L^{-1}')
title('Stage 1 retentate')
set(fig1a,'XTick',[0 8 16])
% Subplot 2 (top-right): Stage 2 Retentate
fig1b = subplot(2,2,2);
hold on
ymin = 0;
ymax = 1.02*1;
fig1b_C2ce1 = scatter(figure1data{1}(:,1),figure1data{1}(:,23));
set(fig1b_C2ce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig1b_C2ce2 = scatter(figure1data{2}(:,1),figure1data{2}(:,23));
set(fig1b_C2ce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig1b_C2cat1 = scatter(figure1data{1}(:,1),figure1data{1}(:,24));
set(fig1b_C2cat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[0.5 0 0.5])
fig1b_C2cat2 = scatter(figure1data{2}(:,1),figure1data{2}(:,24));
set(fig1b_C2cat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 1])
fig1b_C2ce_model = ezplot(fsave(3,1),[xmin, xmax]);
set(fig1b_C2ce_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig1b_C2cat_model = ezplot(fsave(4,1),[xmin, xmax]);
set(fig1b_C2cat_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('Concentration / g.L^{-1}')
title('Stage 2 retentate')
set(fig1b,'XTick',[0 8 16])
% Subplot 3 (bottom-left): Stage 3 Permeate
fig1c = subplot(2,2,3);
hold on
ymin = 0;
ymax = 1.02*0.05;
fig1c_C3ce1 = scatter(figure1data{1}(:,1),figure1data{1}(:,35));
set(fig1c_C3ce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig1c_C3ce2 = scatter(figure1data{2}(:,1),figure1data{2}(:,35));
set(fig1c_C3ce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig1c_C3cat1 = scatter(figure1data{1}(:,1),figure1data{1}(:,36));
set(fig1c_C3cat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[0.5 0 0.5])
fig1c_C3cat2 = scatter(figure1data{2}(:,1),figure1data{2}(:,36));
set(fig1c_C3cat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 1])
fig1c_C3ce_model = ezplot(fsave(7,1),[xmin, xmax]);
set(fig1c_C3ce_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig1c_C3cat_model = ezplot(fsave(8,1),[xmin, xmax]);
set(fig1c_C3cat_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('Concentration / g.L^{-1}')
title('Stage 3 permeate')
set(fig1c,'XTick',[0 8 16])
% Subplot 4 (bottom-right): Overall
fig1d = subplot(2,2,4);
hold on
ymin = 0;
ymax = 1.02*1;
fig1d_Yieldce1 = scatter(figure1data{1}(:,1),figure1data{1}(:,45));
set(fig1d_Yieldce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig1d_Yieldce2 = scatter(figure1data{2}(:,1),figure1data{2}(:,45));
set(fig1d_Yieldce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig1d_Purityce1 = scatter(figure1data{1}(:,1),figure1data{1}(:,47),'d');
set(fig1d_Purityce1,'Marker','d','MarkerEdgeColor','none','MarkerFaceColor',[0 0.5 0.25])
fig1d_Purityce2 = scatter(figure1data{2}(:,1),figure1data{2}(:,47),'d');
set(fig1d_Purityce2,'Marker','d','MarkerEdgeColor','none','MarkerFaceColor',[0.5 1 0])
fig1d_Removalcat1 = scatter(figure1data{1}(:,1),figure1data{1}(:,50),'o');
set(fig1d_Removalcat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 0])
fig1d_Removalcat2 = scatter(figure1data{2}(:,1),figure1data{2}(:,50),'o');
set(fig1d_Removalcat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.9 0])
fig1d_Yieldce_model = ezplot(fsave(9,1),[xmin, xmax]);
set(fig1d_Yieldce_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig1d_Purityce_model = ezplot(fsave(11,1),[xmin, xmax]);
set(fig1d_Purityce_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig1d_Removalcat_model = ezplot(fsave(14,1),[xmin, xmax]);
set(fig1d_Removalcat_model,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('(Yield / Purity / Impurity removal ) / []')
title('Overall separation (1st & 2nd stage)')
set(fig1d,'XTick',[0 8 16])
%% Plot figure 2
% all hard-coded
% need to change
fig2 = figure();
figure2data{1} =
figure2data{2} =
and won't work once 'time' and 'N' change
to soft/variable if code is to be made more flexible
xlsread('matlab_expdata.xlsx','38');
xlsread('matlab_expdata.xlsx','43');
xmin = 0;
xmax = 24;
% Subplot 1 (top-left): Stage 1 Retentate
fig2a = subplot(2,2,1);
hold on
ymin = 0;
ymax = 1.02*1;
fig2a_C1ce1 = scatter(figure2data{1}(:,1),figure2data{1}(:,17));
set(fig2a_C1ce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig2a_C1ce2 = scatter(figure2data{2}(:,1),figure2data{2}(:,17));
set(fig2a_C1ce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig2a_C1cat1 = scatter(figure2data{1}(:,1),figure2data{1}(:,18));
set(fig2a_C1cat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[0.5 0 0.5])
fig2a_C1cat2 = scatter(figure2data{2}(:,1),figure2data{2}(:,18));
set(fig2a_C1cat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 1])
fig2a_C1ce_model1 = ezplot(fsave(1,1),[xmin, 8]);
set(fig2a_C1ce_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2a_C1ce_model2 = ezplot(fsave(1,2),[8, 16]);
set(fig2a_C1ce_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2a_C1ce_model3 = ezplot(fsave(1,3),[16, xmax]);
set(fig2a_C1ce_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2a_C1cat_model1 = ezplot(fsave(2,1),[xmin, 8]);
set(fig2a_C1cat_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2a_C1cat_model2 = ezplot(fsave(2,2),[8, 16]);
set(fig2a_C1cat_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2a_C1cat_model3 = ezplot(fsave(2,3),[16, xmax]);
set(fig2a_C1cat_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('Concentration / g.L^{-1}')
title('Stage 1 retentate')
set(fig2a,'XTick',[0 8 16 24])
% Subplot 2 (top-right): Stage 2 Retentate
fig2b = subplot(2,2,2);
hold on
ymin = 0;
ymax = 1.02*1;
fig2b_C1ce1 = scatter(figure2data{1}(:,1),figure2data{1}(:,23));
set(fig2b_C1ce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig2b_C1ce2 = scatter(figure2data{2}(:,1),figure2data{2}(:,23));
set(fig2b_C1ce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig2b_C1cat1 = scatter(figure2data{1}(:,1),figure2data{1}(:,24));
set(fig2b_C1cat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[0.5 0 0.5])
fig2b_C1cat2 = scatter(figure2data{2}(:,1),figure2data{2}(:,24));
set(fig2b_C1cat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 1])
fig2b_C1ce_model1 = ezplot(fsave(3,1),[xmin, 8]);
set(fig2b_C1ce_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2b_C1ce_model2 = ezplot(fsave(3,2),[8, 16]);
set(fig2b_C1ce_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2b_C1ce_model3 = ezplot(fsave(3,3),[16, xmax]);
set(fig2b_C1ce_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2b_C1cat_model1 = ezplot(fsave(4,1),[xmin, 8]);
set(fig2b_C1cat_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2b_C1cat_model2 = ezplot(fsave(4,2),[8, 16]);
set(fig2b_C1cat_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2b_C1cat_model3 = ezplot(fsave(4,3),[16, xmax]);
set(fig2b_C1cat_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('Concentration / g.L^{-1}')
title('Stage 2 retentate')
set(fig2b,'XTick',[0 8 16 24])
% Subplot 3 (bottom-left): Stage 3 Retentate
fig2c = subplot(2,2,3);
hold on
ymin = 0;
ymax = 1.02*3;
fig2c_C1ce1 = scatter(figure2data{1}(:,1),figure2data{1}(:,29));
set(fig2c_C1ce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig2c_C1ce2 = scatter(figure2data{2}(:,1),figure2data{2}(:,29));
set(fig2c_C1ce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig2c_C1cat1 = scatter(figure2data{1}(:,1),figure2data{1}(:,30));
set(fig2c_C1cat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[0.5 0 0.5])
fig2c_C1cat2 = scatter(figure2data{2}(:,1),figure2data{2}(:,30));
set(fig2c_C1cat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 1])
fig2c_C1ce_model1 = ezplot(fsave(5,1),[xmin, 8]);
set(fig2c_C1ce_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2c_C1ce_model2 = ezplot(fsave(5,2),[8, 16]);
set(fig2c_C1ce_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2c_C1ce_model3 = ezplot(fsave(5,3),[16, xmax]);
set(fig2c_C1ce_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2c_C1cat_model1 = ezplot(fsave(6,1),[xmin, 8]);
set(fig2c_C1cat_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2c_C1cat_model2 = ezplot(fsave(6,2),[8, 16]);
set(fig2c_C1cat_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2c_C1cat_model3 = ezplot(fsave(6,3),[16, xmax]);
set(fig2c_C1cat_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('Concentration / g.L^{-1}')
title('Stage 3 retentate')
set(fig2c,'XTick',[0 8 16 24])
% Subplot 4 (bottom-right): Overall
fig2d = subplot(2,2,4);
hold on
ymin = 0;
ymax = 1.02*1;
fig2d_Yieldce1 = scatter(figure2data{1}(:,1),figure2data{1}(:,45));
set(fig2d_Yieldce1,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 0 0.5])
fig2d_Yieldce2 = scatter(figure2data{2}(:,1),figure2data{2}(:,45));
set(fig2d_Yieldce2,'Marker','s','MarkerEdgeColor','none','MarkerFaceColor',[0 1 1])
fig2d_Purityce1 = scatter(figure2data{1}(:,1),figure2data{1}(:,47),'d');
set(fig2d_Purityce1,'Marker','d','MarkerEdgeColor','none','MarkerFaceColor',[0 0.5 0.25])
fig2d_Purityce2 = scatter(figure2data{2}(:,1),figure2data{2}(:,47),'d');
set(fig2d_Purityce2,'Marker','d','MarkerEdgeColor','none','MarkerFaceColor',[0.5 1 0])
fig2d_Removalcat1 = scatter(figure2data{1}(:,1),figure2data{1}(:,50),'o');
set(fig2d_Removalcat1,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.5 0])
fig2d_Removalcat2 = scatter(figure2data{2}(:,1),figure2data{2}(:,50),'o');
set(fig2d_Removalcat2,'Marker','o','MarkerEdgeColor','none','MarkerFaceColor',[1 0.9 0])
fig2d_Yieldce_model1 = ezplot(fsave(9,1),[xmin, 8]);
set(fig2d_Yieldce_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Yieldce_model2 = ezplot(fsave(9,2),[8, 16]);
set(fig2d_Yieldce_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Yieldce_model3 = ezplot(fsave(9,3),[16, xmax]);
set(fig2d_Yieldce_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Purityce_model1 = ezplot(fsave(11,1),[xmin, 8]);
set(fig2d_Purityce_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Purityce_model2 = ezplot(fsave(11,2),[8, 16]);
set(fig2d_Purityce_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Purityce_model3 = ezplot(fsave(11,3),[16, xmax]);
set(fig2d_Purityce_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Removalcat_model1 = ezplot(fsave(14,1),[xmin, 8]);
set(fig2d_Removalcat_model1,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Removalcat_model2 = ezplot(fsave(14,2),[8, 16]);
set(fig2d_Removalcat_model2,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
fig2d_Removalcat_model3 = ezplot(fsave(14,3),[16, xmax]);
set(fig2d_Removalcat_model3,'Color',[0.5 0.5 0.5],'LineWidth',1.5)
axis([xmin xmax ymin ymax])
xlabel('Time / h')
ylabel('(Yield / Purity / Impurity removal ) / []')
title('Overall separation (1st & 2nd stage)')
set(fig2d,'XTick',[0 8 16 24])
% %}
3. Derivations of steady state mass distribution
Starting from the equations describing the steady state in Section 3.3 of the main manuscript, by setting
𝑑𝐶𝑠,𝑖
𝑑𝑡
= 0.
−
1
𝑟21
∗ 𝐶1,𝑖 ∗ (1 − 𝑅1,𝑖 ) +
𝐶
1 − 𝑟21
1 − 𝑟21 2,𝑖
+ 𝐶3,𝑖 ∗ (1 − 𝑅3,𝑖 ) = 0
Equation 1
+
1
𝑟21
∗ 𝐶1,𝑖 ∗ (1 − 𝑅1,𝑖 ) −
𝐶
− 𝐶2,𝑖 ∗ (1 − 𝑅2,𝑖 )
1 − 𝑟21
1 − 𝑟21 2,𝑖
=0
Equation 2
+ 𝐶2,𝑖 ∗ (1 − 𝑅2,𝑖 ) − 𝐶3,𝑖 ∗ (1 − 𝑅3,𝑖 ) = 0
Equation 3
Rearranging to obtain concentration ratios at steady state:
𝐶1,𝑖 (1 − (1 − 𝑟21 ) ∗ 𝑅2,𝑖 ) (1 − 𝑅3,𝑖 )
=
∗
𝐶3,𝑖
(1 − 𝑅1,𝑖 )
(1 − 𝑅2,𝑖 )
Equation 4
𝐶1,𝑖 (𝑟21 + (1 − 𝑟21 ) ∗ (1 − 𝑅2,𝑖 )) (1 − (1 − 𝑟21 ) ∗ 𝑅2,𝑖 )
=
=
𝐶2,𝑖
(1 − 𝑅1,𝑖 )
(1 − 𝑅1,𝑖 )
Equation 5
𝐶2,𝑖 (1 − 𝑅3,𝑖 )
=
𝐶3,𝑖 (1 − 𝑅2,𝑖 )
Equation 6
From here we can derive the maximum removal fraction. The fraction at steady state in the
solvent recovery stage is given in the manuscript, and it is here reproduced with the simple
algebraic rearrangement.
𝒙𝒕=∞
𝟑,𝒊 =
𝑉3 ∗ 𝐶3,𝑖
=
𝑉1 ∗ 𝐶1,𝑖 + 𝑉2 ∗ 𝐶2,𝑖 + 𝑉3 ∗ 𝐶3,𝑖
1
𝑉1 ∗ 𝐶1,𝑖 𝑉2 ∗ 𝐶2,𝑖
1+𝑉 ∗𝐶 +𝑉 ∗𝐶
3
3,𝑖
3
3,𝑖
1
=
𝑉 (1 − (1 − 𝑟21 ) ∗ 𝑅2,𝑖 ) (1 − 𝑅3,𝑖 ) 𝑉2 (1 − 𝑅3,𝑖 )
1 + 𝑉1 ∗
∗
+ ∗
3
(1 − 𝑅1,𝑖 )
(1 − 𝑅2,𝑖 ) 𝑉3 (1 − 𝑅2,𝑖 )
1
𝟏
=
=
𝑟21 ∗ 𝑅2,𝑖 𝜙3,𝑖 𝜙3,𝑖
𝝓𝟑,𝒊 𝝓𝟑,𝒊
1 + (1 + 1 − 𝑅 ) ∗ 𝜙 + 𝜙
𝟏 + ƒ𝑪,𝒊 𝝓 + 𝝓
2,𝑖
1,𝑖
2,𝑖
𝟏,𝒊
𝟐,𝒊
where
𝝓𝒔,𝒊 =
𝒓𝟐𝟏 𝑹𝟐,𝒊
(𝟏 − 𝑹𝒔,𝒊 )
; ƒ𝑪,𝒊 = (𝟏 +
)
𝑽𝒔
𝟏 − 𝑹𝟐,𝒊
𝑡=∞
𝑡=∞
𝑡=∞
Analogous to 𝑥3,𝑖
, we can derive 𝑥1,𝑖
and 𝑥2,𝑖
.
𝑡=∞
𝑥1,𝑖
=
𝑉1 ∗ 𝐶1,𝑖
=
𝑉1 ∗ 𝐶1,𝑖 + 𝑉2 ∗ 𝐶2,𝑖 + 𝑉3 ∗ 𝐶3,𝑖
=
1
𝑉2 ∗ 𝐶2,𝑖 𝑉3 ∗ 𝐶3,𝑖
1+𝑉 ∗𝐶 +𝑉 ∗𝐶
1
1,𝑖
1
1,𝑖
1
𝑉2 ∗ (1 − 𝑅1,𝑖 )
𝑉3 ∗ (1 − 𝑅1,𝑖 )(1 − 𝑅2,𝑖 )
+
𝑉1 ∗ (1 − (1 − 𝑟21 ) ∗ 𝑅2,𝑖 ) 𝑉1 ∗ (1 − (1 − 𝑟21 ) ∗ 𝑅2,𝑖 )(1 − 𝑅3,𝑖 )
1
=
𝑉2 ∗ 𝜙1,𝑖
1 𝜙1,𝑖
1+
+
∗
(1 − 𝑅2,𝑖 + 𝑟21 𝑅2,𝑖 ) ƒ𝑪,𝒊 𝜙3,𝑖
1+
𝑡=∞
𝑥2,𝑖
=
𝑉2 ∗ 𝐶2,𝑖
=
𝑉1 ∗ 𝐶1,𝑖 + 𝑉2 ∗ 𝐶2,𝑖 + 𝑉3 ∗ 𝐶3,𝑖
1
𝑉 ∗ (1 − (1 − 𝑟21 ) ∗ 𝑅2,𝑖 ) 𝑉3 ∗ (1 − 𝑅2,𝑖 )
1+ 1
+
𝑉2 ∗ (1 − 𝑅1,𝑖 )
𝑉2 ∗ (1 − 𝑅3,𝑖 )
1
=
1+
(1 − 𝑅2,𝑖 + 𝑟21 𝑅2,𝑖 ) 𝜙2,𝑖
+𝜙
𝑉2 ∗ 𝜙1,𝑖
3,𝑖
Equation 7
For 𝑟21 = 0,
𝜙2,𝑖
(1 − 𝑅2,𝑖 + 𝑟21 𝑅2,𝑖 )
𝑠𝑖𝑚𝑝𝑙𝑖𝑓𝑖𝑒𝑠 𝑡𝑜
𝑉2 ∗ 𝜙1,𝑖
𝜙1,𝑖
We can therefore derive the mass distribution between the stages at steady state. Looking at
the mass distribution has the advantage of factoring in the different stage volumes. When
looking at e.g. figures 7 and 8 in the main text, it is not intuitive how the masses are
distributed from the concentration graphs as the stages differ substantially in volume.
The relative masses in each stage after 16 hours can therefore be compared to the predicted
values and they correspond well. The prediction of impurity distribution at steady state is as follows:
𝜙1,𝑐𝑎𝑡 =
451
451
16
1451
≈ 2.255; 𝜙2,𝑐𝑎𝑡 =
≈ 6.443; 𝜙3,𝑐𝑎𝑡 =
≈ 0.291; ƒ𝐶,𝑐𝑎𝑡 =
≈ 1.609; 𝒙𝒕=∞
𝟑,𝒄𝒂𝒕 = 𝟎. 𝟕𝟗𝟖𝟑
200
70
55
902
𝑡=∞
𝑡=∞
𝑥1,𝑖
= 0.1657 ; 𝑥2,𝑖
= 0.036
𝑡=∞
𝑡=∞
𝑡=∞
𝑥1,𝑐𝑎𝑡
: 𝑥2,𝑐𝑎𝑡
: 𝑥3,𝑐𝑎𝑡
= 0.1657 ∶ 0.0360 ∶ 0.7983 and the experimentally measured mass
distribution averaged over the two 16 hour runs is 0.1927:0.0327:0.7746. As also mentioned in the
main text, our model slightly overestimates impurity removal.
4. Washing of the solvent recovery stage
As described on page 25 of the main manuscript, “we ran a washing experiment to confirm workability of
the latter method of several washing cycles, in which the solvent recovery stage was filled with a solution
of catechol at a concentration of 2.7 g.L-1. The solution was circulated briefly without permeate flow, and
then drained and the loop briefly flushed out with air. In one case, the stage was immediately refilled with
pure solvent and, after recirculation, the residual catechol concentration was measured as 0.038 g.L-1
equivalent to around 1.39 % of the original solution content. In another case, after draining, only the
membrane cell within which most of the residual impurity was suspected was additionally rinsed with
around 5 mL of solvent before refilling the loop with fresh solvent and recirculating, and in this case the
residual catechol concentration was only 0.019 g.L-1 or 0.68 % of the original.”
Catechol
HPLC for feed
Draining, no rinsing of the cell, then filling up
HPLC for feed
Draining, rinsing the cell with 5 mL, then filling up
5. HPLC method
[Gyorgy]
Peak
Concentration
Area
(g/L)
5273
2.7310
286
0.0379
5312
2.7512
137
0.0187
1.39%
0.68%
6. On the selection of stage membrane areas
We here describe briefly how to select the relative and absolute membrane areas of the
stages. As given in equation 1 and 2 of the main manuscript, the flowrates between the
stages are not independent.
𝑟21 =
𝐹2
𝐹2
=
𝐹1 𝐹2 + 𝐹4
Equation 8
𝑉̇ =
𝐹1
𝐹2
=
= 𝐹3 = 𝐹4
𝑟21
1
(
) (1 − 𝑟 )
1 − 𝑟21
21
Equation 9
The recycle ratio is an operator controlled parameter and it this work we have chosen it to be
0.5. The recycle ratio will be chosen as a trade-off between yield, purity and processing time
per membrane area. We also have some simplification when the same membrane is used in
each separation stage as the permeances of the membrane will be the same and the
transmembrane pressure should probably be roughly similar as it will be optimised in each
stage to give the maximum selectivity – in most cases this will be the highest pressure that
can be operated at without damaging the membrane. Then we have the following flow
diagram.
The stage 1 permeate needs to be around twice as large as the stage 2 permeate for an r 21 =
0.5, and for similar permeances in stage 1 and 2 (B1 = B2) and similar transmembrane
pressures (ΔP1 = ΔP2), we should choose an approximate membrane area ratio of A1 = 𝐴1 =
1
)∗
1−𝑟21
(
𝐴2 = 2 ∗ 𝐴2 .
Depending on the choice of solvent recovery membrane, the permeability, B3, may differ
from that in the separation stages. One should have an idea of which transmembrane
pressure range is acceptable for the solvent recovery stage. Oversizing the membrane area,
A3, will result in too low a transmembrane pressure in the solvent recovery stage and this
may negatively impact on the rejection properties of the solvent recovery membrane. On the
other hand, undersizing A3 may necessitate operating at a lower volumetric flowrate
through the system when it is found that for the given 1st and 2nd stage pressures, 𝑉̇ is so
high that it causes the transmembrane pressure in the 3rd stage to rise to excessive levels.
When operating with membrane modules, there may be restrictions with regards to the sizes
of modules available and clearly the area of the smallest available module size is the smallest
denominator by which the solvent recovery area can be increased.
There is another side to the problem when operating in non-dilute, i.e. more concentrated
systems, where osmotic pressure and concentration polarization may play a role.
Concentration polarization may result in a lower rejection which may necessitate choosing
e.g. a tighter solvent recovery membrane, if available, or using a larger solvent recovery
stage volume to reduce concentration.
More importantly, if osmotic pressure is significant in this 3-stage set-up, the first separation
stage of the cascade (stage 1) and the solvent recovery stage (stage 3) will be much more
concentrated than the second stage. The impurity will accumulate in the solvent recovery
stage, and at least in the first diafiltration interval before the first washing, osmotic pressure
in the solvent recovery stage may be significant. After the first wash, the osmotic pressure
will only be a fraction of that in the first interval, depending on the total removal per
interval. On the other hand, the product will remain largely in the 1st separation stage
throughout each interval as it does not wash out into the 3rd stage to a significant degree
(which is good as that would be equivalent to yield loss).
In concentrated systems, the stage 1 area, A1, should therefore be larger than it would be in a
dilute system:
1
𝐴1 > (
) ∗ 𝐴2
1 − 𝑟21
As in other membrane work,
𝐽 = 𝐵 ∗ (∆𝑃 − ∆𝑃)
where J [L.m-2.h-1] is the flux, B [L.m-2.h-1.bar-1] is permeance, and ΔP and Δπ are the
transmembrane pressure and the counteracting osmotic pressure gradient respectively. The
osmotic pressure will start to become significant for concentrated systems and can be
estimated e.g. by the Van’t Hoff formula or by the solution diffusion model.
For further reading on the approach we recommend e.g. E.S. Tarleton, J.P. Robinson, C.R.
Millington, A. Nijmeijer, M.L. Taylor, The influence of polarity on flux and rejection
behaviour in solvent resistant nanofiltration—Experimental observations, Journal of
Membrane Science, 278 (2006) 318-327.
7. Screening data
PEEK
1
2
3
20PBI
AVG
SD
1
2
3
20PBI.X
AVG
SD
1
2
3
GMT-NC-1
AVG
SD
1
2
3
GMT-oNF-1
AVG
SD
1
Pressure / bar
2
3
AVG
GMT-oNF-2
SS010206
SS010306
SS030306
SD
1
2
3
AVG
SD
1
2
3
AVG
SD
1
2
3
AVG
SD
1
2
3
AVG
SD
Flux / L.m-2.h-1
5
51.2
47.4
52.7
50.4
2.7
10
67.6
74.3
72.1
71.3
3.4
15
99.2
98.4
91.8
96.5
4.1
31.3
31.3
31.8
31.4
0.3
32.4
32.1
32.4
32.3
0.2
20
56.8
58.5
58.0
57.8
0.9
59.1
61.4
59.7
60.0
1.2
1.1
1.5
3.0
1.9
30
84.1
84.4
84.4
84.3
0.2
87.3
87.3
88.1
87.5
0.5
8.2
7.1
5.4
6.9
18.0
19.0
18.9
18.6
0.6
27.8
29.3
29.0
28.7
0.8
11.8
11.6
11.9
11.8
0.2
27.7
28.4
28.5
28.2
0.5
14.5
14.9
15.1
14.8
0.3
1.0
30.7
32.2
31.4
31.4
0.8
47.2
48.5
47.7
47.8
0.6
22.5
22.7
22.3
22.5
0.2
55.5
56.1
54.9
55.5
0.6
27.8
29.0
28.4
28.4
0.6
1.4
39.4
39.0
39.0
39.1
0.2
59.9
60.0
70.5
63.4
6.1
38.6
38.9
39.2
38.9
0.3
75.6
72.4
71.6
73.2
2.1
40.9
39.6
39.2
39.9
0.9
Permeance / L.m-2.h-1.bar-1
5
10.2
9.5
10.5
10.1
0.5
10
6.8
7.4
7.2
7.1
0.3
15
6.6
6.6
6.1
6.4
0.3
3.1
3.1
3.2
3.1
0.0
3.2
3.2
3.2
3.2
0.0
20
2.8
2.9
2.9
2.9
0.0
3.0
3.1
3.0
3.0
0.1
0.1
0.1
0.2
0.1
30
2.8
2.8
2.8
2.8
0.0
2.9
2.9
2.9
2.9
0.0
0.3
0.2
0.2
0.2
1.8
1.9
1.9
1.9
0.1
2.8
2.9
2.9
2.9
0.1
1.2
1.2
1.2
1.2
0.0
2.8
2.8
2.9
2.8
0.0
1.4
1.5
1.5
1.5
0.0
0.0
1.5
1.6
1.6
1.6
0.0
2.4
2.4
2.4
2.4
0.0
1.1
1.1
1.1
1.1
0.0
2.8
2.8
2.7
2.8
0.0
1.4
1.4
1.4
1.4
0.0
0.0
1.3
1.3
1.3
1.3
0.0
2.0
2.0
2.3
2.1
0.2
1.3
1.3
1.3
1.3
0.0
2.5
2.4
2.4
2.4
0.1
1.4
1.3
1.3
1.3
0.0
Rejection of crown ether / %
5
100.0
100.0
100.0
100.0
0.0
10
100.0
100.0
100.0
100.0
0.0
15
100.0
100.0
100.0
100.0
0.0
83.4
85.1
85.7
84.7
1.2
94.7
95.1
94.4
94.7
0.4
20
91.2
92.0
93.0
92.1
0.9
97.7
97.0
97.0
97.2
0.4
100.0
100.0
100.0
100.0
30
98.6
97.9
97.8
98.1
0.4
99.5
99.7
99.3
99.5
0.2
100.0
100.0
100.0
100.0
94.0
94.7
93.5
94.1
0.6
93.0
91.1
92.6
92.2
1.0
95.9
96.1
96.3
96.1
0.2
93.4
92.5
94.2
93.4
0.9
88.6
87.3
86.9
87.6
0.9
0.0
97.0
96.1
95.3
96.1
0.9
94.8
94.2
93.2
94.1
0.8
96.6
97.4
96.9
97.0
0.4
97.1
96.2
95.7
96.3
0.7
89.7
90.6
91.2
90.5
0.7
0.0
98.6
96.8
97.2
97.6
1.0
95.5
96.4
95.2
95.7
0.7
98.0
98.6
99.0
98.5
0.5
98.1
99.3
96.7
98.0
1.3
92.7
93.3
94.0
93.4
0.7
Rejection of catechol / %
5
98.4
98.0
98.9
98.4
0.5
10
99.5
99.3
99.4
99.4
0.1
15
99.9
99.9
99.9
99.9
0.0
43.6
41.5
40.7
41.9
1.5
60.6
58.9
57.2
58.9
1.7
20
47.8
48.9
47.2
48.0
0.8
71.3
71.8
70.8
71.3
0.5
92.7
92.8
92.4
92.6
30
56.7
55.1
52.8
54.9
2.0
77.3
76.5
75.7
76.5
0.8
95.4
95.8
95.5
95.6
56.7
55.4
54.3
55.5
1.2
48.4
50.2
49.3
49.3
0.9
63.6
64.5
65.2
64.4
0.8
56.8
55.9
56.1
56.3
0.5
38.8
37.5
39.7
38.7
1.1
0.2
56.5
58.5
57.9
57.7
1.0
52.3
53.9
51.4
52.6
1.3
67.0
66.8
66.2
66.7
0.4
69.0
69.6
68.5
69.1
0.5
44.8
43.1
42.7
43.5
1.1
0.2
63.2
62.0
60.7
62.0
1.3
53.9
54.9
53.2
54.0
0.9
73.1
71.3
73.6
72.7
1.2
74.2
73.5
72.4
73.4
0.9
45.9
47.1
45.3
46.1
0.9
Selectivity / []
5
∞
∞
∞
∞
∞
10
∞
∞
∞
∞
∞
15
∞
∞
∞
∞
∞
3.4
3.9
4.2
3.8
0.4
7.5
8.4
7.6
7.8
0.5
20
5.9
6.4
7.5
6.6
0.8
12.7
9.3
9.7
10.6
1.9
∞
∞
∞
∞
30
30.8
21.8
21.2
24.6
5.4
44.4
89.5
35.9
56.6
28.8
∞
∞
∞
∞
7.2
8.5
7.0
7.5
0.8
7.4
5.6
6.9
6.6
0.9
8.9
9.1
9.3
9.1
0.2
6.5
5.9
7.5
6.6
0.8
5.4
4.9
4.6
5.0
0.4
∞
14.6
10.6
8.9
11.4
2.9
9.1
8.0
7.2
8.1
1.0
9.7
12.7
10.9
11.1
1.5
10.6
8.1
7.3
8.7
1.7
5.4
6.0
6.5
6.0
0.6
∞
27.2
11.8
14.2
17.8
8.3
10.1
12.7
9.7
10.8
1.6
13.3
20.7
25.6
19.9
6.2
13.4
36.8
8.3
19.5
15.2
7.4
7.9
9.2
8.2
0.9
8. Further discussion:
8.1 Maximum selectivity in a two-stage cascade with recycle
Let us look at the scenario of total recycle. We need to write up a new set of mass balances as
the set of equations derived for 0 < r21 < 1 will break i.e. is discontinuous at r21 = 1.
Taking a mass balance around stage 2 at total recycle and steady state, we obtain
𝑆𝑡𝑎𝑔𝑒 2:
𝑑𝐶2,𝑖
𝑉̇
= (+ (1 − 𝑅1,𝑖 ) ∗ 𝐶1,𝑖 − 𝐶2,𝑖 ) = 0
𝑑𝑡
𝑉2
𝐶2,𝑖 = (1 − 𝑅1,𝑖 ) ∗ 𝐶1,𝑖
If we now look at the permeate flow from stage 2 infinitely close but just below this limit
(r21 → 1- ), we obtain
𝐹2,𝑝𝑒𝑟𝑚𝑒𝑎𝑡𝑒,𝑖 = 𝑉̇ ∗ (1 − 𝑅2,𝑖 ) ∗ 𝐶2,𝑖 = 𝑉̇ ∗ (1 − 𝑅2,𝑖 ) ∗ (1 − 𝑅1,𝑖 ) ∗ 𝐶1,𝑖
which for similar membranes in both separation stages simplifies to
2
𝐹2,𝑝𝑒𝑟𝑚𝑒𝑎𝑡𝑒,𝑖 = 𝑉̇ ∗ (1 − 𝑅1,𝑖 ) ∗ 𝐶1,𝑖
This system is of course practically meaningless as for total recycle and no permeate flow
from the second stage, no fluid is being processed by this cascade. However, the limiting
scenario does provide us with a best case estimate for system rejection of a two-stage
cascade and when bearing in mind that the performance of a real cascade will be worse,
helps us with a preliminary estimate. At the same time, a two-stage cascade system with no
recycle is also meaningless, this time from a purification perspective, as it does not help to
increase selectivity.
Without attempting to provide a mathematically rigorous derivation and if there could be a
description of two stage overall system rejection (not necessarily constant over time), it is
therefore probably fair to state that:
2
(1 − 𝑅𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑖 ) < (1 − 𝑅𝒕𝒘𝒐−𝒔𝒕𝒂𝒈𝒆,𝑖 ) < (1 − 𝑅𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑖 )
2
(𝑃𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑖 ) < (𝑃𝒕𝒘𝒐−𝒔𝒕𝒂𝒈𝒆,𝑖 ) < (𝑃𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑖 )
In a similar manner, we should find that for a two component system, selectivity for
permeation of the impurity should be bound as follows:
𝛼𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒 =
(1 − 𝑅𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑖𝑚𝑝𝑢𝑟𝑖𝑡𝑦 )
(1 − 𝑅𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑝𝑟𝑜𝑑𝑢𝑐𝑡 )
< 𝛼𝒕𝒘𝒐−𝒔𝒕𝒂𝒈𝒆 =
(1 − 𝑅𝒕𝒘𝒐−𝒔𝒕𝒂𝒈𝒆,𝑖𝑚𝑝𝑢𝑟𝑖𝑡𝑦 )
(1 − 𝑅𝒕𝒘𝒐−𝒔𝒕𝒂𝒈𝒆,𝑝𝑟𝑜𝑑𝑢𝑐𝑡 )
(1 − 𝑅𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑖𝑚𝑝𝑢𝑟𝑖𝑡𝑦 )
< (𝛼𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒 ) = (
)
(1 − 𝑅𝑠𝑖𝑛𝑔𝑙𝑒−𝑠𝑡𝑎𝑔𝑒,𝑝𝑟𝑜𝑑𝑢𝑐𝑡 )
2
2
9. Tabulated data of the diafiltration results
The experimental data gathered for the diafiltration runs, both continuous and semicontinuous with washing, is shown in table 1 and table 2 below.
General rules

Concentrations were measured indirectly via UV and MS peak areas from HPLC traces.

UV and MS peak areas are given as the integrated values without regard for the
integration error and without regard for the number of significant figures.

o
values measured by UV are shown in normal type
o
values measures by MS are shown in bold type
All concentrations and mass values are given to 3 significant figures, although some
values may not be precise to 3 s.f. where measured peak areas are low.
Limits of detection:

UV LOD was 10 ppm (0.01 g.L-1)

MS LOD was 0.1 ppm (0.0001 g.L-1)
Empty cells and zero values:

Where cells are empty, measurements have not been taken.

Where a cell shows “0”, the measurement was taken but solute concentration i.e.
measured peak area was below the limit of detection.
The limit of detection is different for UV and MS measurements so zeroes in bold type
“0” will indicate a lower LOD than a normal type zero “0”. In most cases, MS
measurements have been taken where the concentration would have been expected to
lie below the LOD of UV measurement but where it was assumed to be at a level
detectable by MS.
As a notable exception, we have failed to measure by MS between 16.5 – 18.5 hours for
the first semi-continuous diafiltration run (CDI I 38) for the stage 3 retentate and only
measured by UV. When comparing to the second of those runs (CDI I 43) where we
have measured by MS for that time period, it is clear that those values are probably nonzero but simply below the LOD of UV. To the best of our knowledge, this is the only
example where this occurred.

Where peak areas were below LOD and indicated as 0, the corresponding mass and
concentration cells are left empty rather than also set to 0 for clarity.

There are some zeroes marked up specifically and the following exceptions apply:
o
o
0†: not measured but should be 0 as a result of the start-up procedure
0*: not measured and possibly not exactly 0 but assumed 0 for modelling
purposes
Calibration curves
The following calibration was used to relate peak area to concentration for all UV
measurements.
Peak Area
Concentration (g.L-1)
Concentration
(ppm)
Crown ether
Catechol
1
1000
11756
7747
0.75
750
8782
5769
0.5
500
6134
3905
0.25
250
3393
1814
0.1
100
1776
803
0.05
50
1137
384
0.01
10
547
104
1200
Concentration / ppm
1000
y = 0.1293x + 0.9466
R² = 0.9997
800
y = 0.0898x - 50.136
R² = 0.9995
600
400
Catechol
Crown ether
200
0
0
2000
4000
6000
8000
10000
12000
14000
Peak Area / []
The following equations were therefore used, note that they were not forced through the
origin.
𝐶𝑠,𝑐𝑒 = 0.0898 ∗ 𝐴𝑈𝑉 − 50.136
𝐶𝑠,𝑐𝑎𝑡 = 0.1293 ∗ 𝐴𝑈𝑉 + 0.9466
The following equations were used for the mass spectrometry measurements:
𝐶𝑠,𝑐𝑒 = (𝐴𝑀𝑆 + 32759.561)/38484377.1107
𝐶𝑠,𝑐𝑎𝑡 = 7 ∗ 10−8 ∗ 𝐴𝑀𝑆 + 0.0011