Sunteți pe pagina 1din 8

Linear Algebra with MATLAB

error propagation
SOLUTIONS
1

Exercise #1

The yeast S. cerevisiae is grown anaerobically in chemostat experiments. It is well known that under aerobic
conditions a strict coupling of substrate uptake, growth, ethanol formation as well as glycerol production is found.
Based on the redox balance and the biomass synthesis pathways, a growth reaction can be determined:

0.5081 GLC + z ATP


1C1H1.76 N 0.168O0.56 0.44 Glyc + 0.227 CO2
The ATP requirements for the growth reaction are yet unknown for this yeast. Under anaerobic conditions, the only
source of ATP is ethanol formation:

GLC 2 EtOH 2CO 2 2ATP


Which will cover requirements for growth and maintenance. The two reactions can be combined to obtain a HP
relation for the growth reaction:

1C1H1.76 N 0.168O0.56 0.44 Glyc + 0.227 CO 2 z EtOH


0.5081+ GLC
2

The Herbert-Pirt relation should now be used to determine the ATP requirements z and the maintenance
requirements. We can rewrite the HP relation as a function of z and ms:

qS 0.5081 mS
2

Similarly, the relation for qCO2 can be derived:

qEtOH z 2 mS
Table 1: Observed rate for anaerobic chemostat cultivations of S. cerevisiae. All rates are in mol/Cmol/h

D
0.28
0.21
0.15
0.1
0.06

qS
0.50
0.39
0.29
0.22
0.15

qEtOH
0.71
0.56
0.44
0.33
0.25

qGlyc
0.12
0.09
0.07
0.04
0.03

qCO2
0.89
0.73
0.59
0.47
0.38

TASKS
a. Determine the parameters z and mS from the experimental data.
This is a regression problem. Two parameters have to be determined, z and mS, in total 5 measurements are
available. The system is redundant.
IAM MATLAB - 2015/16, S.A. Wahl

Page 1 of 8

Step 1: Define vector of unknown:

z

mS
Step 2: Generate matrix A

qS 0.5081 mS
2

Known and unknow separate on left and right side:

Step 3 separate known and unknown:

qS 0.5081

z mS
2

Now in Matrix notation using :

qS 0.5081
1
2

Setp 4: Solve for all observations

2 1
qS ,1 0.50811

qS ,2 0.50812 2 1


qS ,5 0.50815

5
1

AT A AT b

In MATLAB:
% exercise 1 from linear regression & error propagation
% Determine ATP requirements for biomass synthesis
% measurements contain mu, qS, qEtOH, qGlyc, qCO2
data = ...
[ 0.28
0.21
0.15
0.10
0.06

0.50
0.39
0.29
0.22
0.15

0.71
0.56
0.44
0.33
0.25

0.12
0.09
0.07
0.04
0.03

0.89
0.73
0.59
0.47
0.38 ];

mu = data(:,1);
qS = data(:,2);
qEtOH = data(:,3);
%
%
%
%
%

from the exercise sheet we know:


qS = (0.5081 + z/2) * mu + mS
separate known and unknown
qS = 0.5081 * mu + mu/2 * z + mS

% formulate as A*beta = b, with beta = ( z, mS )


A = [mu/2 ones(size(mu))];
b = qS - 0.5081 * mu;

IAM MATLAB - 2015/16, S.A. Wahl

Page 2 of 8

beta = inv(A' * A) * A' * b;


disp( 'estimation of z and mS:')
disp( beta' )

b. Calculate the standard deviation for z and mS. assuming that qS is measured with a standard deviation (absolute)
of 0.05 mol/Cmol/h independent of the dilution rate (homoscledastic).
Following linear error propagation, we need the derivative of the unknown vector with respect to the observations
qS:
1

AT A AT y

1
d
AT A AT
dy

The the covariance of the unknowns becomes:


T

d d
S
Sy

dy dy
In MATLAB:
% determine accuracy of the estimtaion
% construct the covariance matrix for qS
S_qS = diag( 0.05^2 * ones(size(qS)) );

% the jacobian matrix is the derivative of inv(A' * A) * A' * b with


% respect to b:
J = inv(A' * A) * A';
cov_beta = J * S_qS * J';
% from the diagonal the variances are obtained:
s_beta = diag( cov_beta ).^0.5;
disp( 'accuracy of the estimation:' )
disp( s_beta' )

c.

Include the measurements for ethanol in the estimation of z and mS

To include the ethanol measurements, the equation system is expanded with these measurements:
q A
S S


q
EtOH AEtOH

The equations for EtOH are derived from the given equation, qEtOH z 2 mS , i.e.

qEtOH ,1 1


qEtOH ,2 2


qEtOH ,5 5

2
2

In MATLAB:
% separate different As by subindex A_S and A_EtOH
A_S = [mu/2 ones(size(mu))];
b_S = qS - 0.5081 * mu;

IAM MATLAB - 2015/16, S.A. Wahl

Page 3 of 8

%%% include also qEtOH


% the equation for qEtOH is straigth forward:
% qEtOH = mu*z + 2*mS
% separating known and unknown, rewrite in matrix notation:
A_EtOH = [ mu, 2*ones(size(mu)) ];
% construct covariance matrix:
S_qE = diag( 0.05^2 * ones( size(mu)) );

% for c S_qE = I

% combine these equations with qS


A = [A_S; A_EtOH];
b = [b_S; qEtOH];
S = blkdiag( S_qS, S_qE );
beta = inv( A' * S^-1 * A) * A'*SS^-1 * b;
disp( 'estimation of z and mS using qS and qEtOH:')
disp( beta' )
J = inv( C' * S^-1 * C) * C'*S^-1;
SS_beta = J * S * J';

d. The ethanol rate is determined with a standard deviation of 0.05 mol/Cmol/h, how accuarate is the estimation of
the parameters now?
Already done in c

Exercise #2

The Herbert-Pirt parameters for a lactic acid producing strain should be determined to set up process models and
optimize the production conditions.
The experiments are performed at pH 4.0, in a 1L bioreactor with glucose as substrate (75 mmol/L). Your colleague
has already calculated all biomass specific rates (Table 2), but needs helps to determine the HP coefficients.
Table 2: Biomass specific rates during chemostat runs at different dilution rates.

qS

qLac

qGlyc

qCO2

qO2

0.3

0.248

0.264

0.030

0.225

0.116

0.15

0.159

0.177

0.031

0.131

0.061

0.1

0.120

0.131

0.030

0.106

0.035

0.05

0.076

0.075

0.028

0.075

0.016

0.03

0.053

0.050

0.026

0.047

0.012

TASKS
a. Determine the coefficients of the Herbert-Pirt relation for this set of experiments. Use linear algebra and the
available experimental data from all experiments. Ther Herbert-Pirt relation reads:

qS a b qLac c qGly mS
Construct the respective matrix and perform the regression. Is this system determined, underdetermined or
redundant?
The unknowns are the HP parameters a, b, c and mS, thus four unknown. There are 5 measurements, that are
linearly independent, thus 5-4 = 1 redundant observations.

IAM MATLAB - 2015/16, S.A. Wahl

Page 4 of 8

Step 1: Generate vector of unknowns:

a

b

c

mS
Step 2: Generate matrix A

qS a bqLac c qGlyc mS

Known and unknow separate on left and right side:

Step 3 separate known and unknown:


Already separated

qS

Now in Matrix notation using :

qLac 1

Setp 4: Solve for all observations

qS ,1 1 qLac ,1 qGlyc ,1 1

qS ,2 2 qLac,2 qGlyc ,2 1

qS ,5 5 qLac ,5 qGlyc,5 1

b
A
% measurements contain
%D
qS
data = [ 0.3
0.248
0.15
0.159
0.1
0.120
0.05
0.076
0.03
0.053

qLac
0.264
0.177
0.131
0.075
0.050

AT A AT b

qGlyc
0.030
0.031
0.030
0.028
0.026

qCO2
0.225
0.131
0.106
0.075
0.047

qO2
0.116
0.061
0.035
0.016
0.012 ];

mu = data(:,1);
qS = data(:,2);
qLac = data(:,3);
qGlyc = data(:,4);
% from the exercise sheet we know:
% qS = a * mu + b * qLac + c*qGlyc + mS
% formulate as A*beta = b, with beta = ( z, mS )
A_S = [mu qLac qGlyc ones(size(mu))];
b_S = qS;
beta = inv(A_S' * A_S) * A_S' * b_S;
disp( 'estimation of a, b, c and mS:')
disp( beta' )

b. Calculate the accuracy of the determined parameters. From previous repeated experiments it is known that the
standard deviation for the rate determination of qS is

0.05 .

Following linear error propagation, we need the derivative of the unknown vector with respect to the observations
qS:

IAM MATLAB - 2015/16, S.A. Wahl

Page 5 of 8

AT A AT y

1
d
AT A AT
dy

The the covariance of the unknowns becomes:


T

d d
S
Sy

dy dy
In MATLAB:
% determine accuracy of the estimtaion
% construct the covariance matrix for qS
S_qS = diag( 0.05^2 * ones(size(qS)) );

% the jacobian matrix is the derivative of inv(A' * A) * A' * b with


% respect to b:
J = inv(A' * A) * A';
cov_beta = J * S_qS * J';
% from the diagonal the variances are obtained:
s_beta = diag( cov_beta ).^0.5;
disp( 'accuracy of the estimation:' )
disp( s_beta' )

c.

To improve the estimation it is suggested to also take the O2 and CO2 measurements into account. The relation
between qO2, qCO2 and the Herbert Pirt parameters a, b and ms can be derived from the stoichiometry:

Growth: a GLC 6 a

Lactic acid production:

9
3

1C1H1.8O0.5 N 0.1 6a H 2 O 6 a 1 CO 2 0.1H +


O 2 0.1NH 4
8
4

qlac
b GLC 6b 3 O 2
1C3H 6 O3 6b 3 H 2O 6b 3 CO 2

Glycerol formation c GLC 6c

7
qlac
O2 1C3H8O3 6c 4 H 2O 6c 3 CO2
2

S
Maintenance: c GLC 6O 2
6CO2 6 H 2O

Summing these processes the equation for qO2 and qCO2 is obtained:

9
7

qO 2 6a 6b 3 qlac 6c q gly 6 m , qCO 2 6a 1 6b 3 qlac 6c 3 qgly 6 m


8

Generate the equation system in matrix notation that can express qS, qO2 and qCO2 as a function of the Herbert-Pirt
parameters a, b and ms. Perform a regression taking all experimental data into account. The standard deviation for
the offgas-measurements is

0.07 . How accurate are the results now? Compare to the calculations with only

using qS,

Tip: Group the expected results for the experiments in one vector:

IAM MATLAB - 2015/16, S.A. Wahl

Page 6 of 8

qS ,1
qO 2,1
qCO 2,1

qS ,2
qO 2,2
qCO 2,2
qS
, qO 2
, q CO 2


qS , n
qO 2,n
qCO 2,n

q exp

qS
qO 2
q
CO 2

% measurements contain mu, qS, qEtOH, qGlyc, qCO2


%D
data = [ 0.3
0.15
0.1
0.05
0.03

qS
0.248
0.159
0.120
0.076
0.053

qLac
0.264
0.177
0.131
0.075
0.050

qGlyc
0.030
0.031
0.030
0.028
0.026

qCO2
0.225
0.131
0.106
0.075
0.047

qO2
0.116
0.061
0.035
0.016
0.012 ];

mu = data(:,1);
qS = data(:,2);
qLac = data(:,3);
qGlyc = data(:,4);
qO2 = data(:,6);
qCO2 = data(:,5);
% from the exercise sheet we know:
% qS = a * mu + b * qLac + c*qGlyc + mS
% formulate as A*beta = b, with beta = ( z, mS )
A_S = [mu qLac qGlyc ones(size(mu))];
b_S = qS;
beta = inv(A_S' * A_S) * A_S' * b_S;
disp( 'estimation of a, b, c and mS:')
disp( beta' )
% part b
% determine accuracy of the estimtaion
% construct the covariance matrix for qS
S_qS = diag( 0.05^2 * ones(size(qS)) );
% the jacobian matrix is the derivative of inv(A' * A) * A' * b with
% respect to b:
J = inv(A_S' * A_S) * A_S';
cov_beta = J * S_qS * J';
% from the diagonal the variances are obtained:
s_beta = diag( cov_beta ).^0.5;
disp( 'accuracy of the estimation:' )
disp( s_beta' )
%%% include also qO2
% the equation for qEtOH is straigth forward:
% qO2 = (6a-9/8)*mu + (6b -3)*qLac + (6c-7/2)qGlyc + 6*mS
% separating known and unknown, rewrite in matrix notation:
A_O2 = [ 6*mu, 6*qLac 6*qGlyc 6*ones(size(mu)) ];
b_O2 = qO2 + 9/8*mu + 3*qLac + 7/2*qGlyc;
% construct covariance matrix:
S_O2 = diag( 0.07^2 * ones( size(mu)) );
%%% include also qCO2
% the equation for qEtOH is straigth forward:
% qCO2 = (6a-1)*mu + (6b -3)*qLac + (6c-3)qGlyc + 6*mS

IAM MATLAB - 2015/16, S.A. Wahl

Page 7 of 8

% separating known and unknown, rewrite in matrix notation:


A_CO2 = [ 6*mu, 6*qLac 6*qGlyc 6*ones(size(mu)) ];
b_CO2 = qCO2 + 1*mu + 3*qLac + 3*qGlyc;
% construct covariance matrix:
S_CO2 = diag( 0.07^2 * ones( size(mu)) );
% combine these equations with qS
A = [A_S; A_O2; A_CO2];
b = [b_S; b_O2; b_CO2];
S = blkdiag( S_qS, S_O2, S_CO2 );
beta = inv( A' * S^-1 * A) * A' * S^-1 * b;
disp( 'estimation of a, b and c using qS, qO2 and qCO2:')
disp( beta' )
J = inv( A' * S^-1 * A) * A' * S^-1;
S_beta = J * S * J';
% from the diagonal the variances are obtained:
s_beta = diag( S_beta ).^0.5;
disp( 'accuracy of the estimation:' )
disp( s_beta' )

The parameters a, b, c and mS are correlated and therefore complicated to determine. Including qO2 and qCO2
significantly improves the estimation quality, as the system now has 12 redundancies compared to only 1 when only
using qS. Nevertheless, c remains ill determined (here the issue is that the values for qGlyc are very low, leading to a
high amplification in the (pseudo) inverse (A*A)^-1.
Using only qS we obtain:
0.49 5.62

0.22 8.41



3.72 81.0

0.07 1.89

Actually no parameter is determined (all >10000% standard deviation)


Including qO2 and qCO2:
0.31 0.91

0.42 1.37

1.5 13.1


0.02 0.30

At least, the deviation is reduced to about 300% for a and b. For c and mS it is still not sufficient with these
measurements. An option could be to also include the glycerol measurements in the estimation.
Or find more accurate measurement instruments.

IAM MATLAB - 2015/16, S.A. Wahl

Page 8 of 8

S-ar putea să vă placă și