fmincon in MATLAB
Xueyang Feng
Dept. of Energy, Environmental & Chemical
Engineering
fengx@seas.wustl.edu
Parameter Estimation
References
(e.g. literature)
Mathematic
Model
References
(e.g. literature)
Mathematic
Model
v.s.
Known
Parameters
Unknown
Parameters
Simulated
Results
Parameter
estimation
v.s.
Forward problem
Experimental
Results
Simulated
Results
Inverse problem
Experimental
Results
Bioreactor model
dX
X
dt
dP
YP / X X
dt
dS
1
X X
dt
YX / S
max S
KS S
Experimental data
t
0.0
3.0
6.0
9.0
12.0
15.0
18.0
21.0
24.0
27.1
X
0.51
0.15
0.42
0.56
0.33
0.09
1.01
1.60
2.62
3.73
P
0.28
0.47
0.21
0.61
0.12
0.09
0.16
0.34
0.52
1.13
S
14.86
14.93
14.30
14.00
13.80
12.00
11.11
6.00
3.50
0.70
fmincon in MATLAB
[x fval] = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)
Estimated
parameters
Boundaries of
the parameters
%reactor model
S0=beta(5);
y0=[0.05 0 S0];
tspan=t; %we want y at every t
[t,y]=ode45(@ff,tspan,y0);
x=t;
global yobs
global t
yobs=[X;P;S];
umax=0.1;
Ks=10;
Ypx=0.11;
Yxs=0.45;
S0=14.86;
beta0(1)=umax; %initial guess
beta0(2)=Ks; %initial guess
beta0(3)=Ypx; %initial guess
beta0(4)=Yxs; %initial guess
beta0(5)=S0; %initial guess
[param, fval] =
fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)
Run the
model again to
A: Randomly perturb the initial
guess
n=length(t);
Xpred=ypred(1:n);
Ppred=ypred(n+1:2*n);
Spred=ypred(2*n+1:3*n);
figure(1)
set(gca, 'fontsize',14,'fontweight','bold');
hold on
plot(x,Xpred,'-r','linewidth',2.5);
plot(x,Ppred,'-g','linewidth',2.5)
plot(x,Spred,'-b','linewidth',2.5)
plot(x,X,'r+','markersize',10);
plot(x,P,'go','markersize',10)
plot(x,S,'bx','markersize',10)
xlabel('time')
ylabel('y')
legend('X g/L','P g/L','S g/L')
3.8128
fval =
4.3559
0.2606
0.3029