# Kp=Hmax single first-order kinetic term with delayed effect

1 view (last 30 days)
Hi everyone, im trying to generate a single first-order kinetic term with delayed effec (SFO)t. then after running the code, it comes out like this
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.
<stopping criteria details>
67 Kp = Hmax;
what does the Kp=Hmax means, because when i run order of the second kode of degradation (DFO), it gave me Kp,Tb,Tp,q,Rst values but SFO keeps giving me 67 Kp = Hmax; even when i tried with different datas.
This is my function for identSFO, the one that i bold is where it said : <stopping criteria details>
67 Kp = Hmax;
function [K,Kp,Tp,Tb,q,J,eflag,Rst]=identSFO(T,Xe,K0i)
% Assuming single first-order kinetic term with delayed effect
K0a = [5, 2]; % intial guess
% Specify the sampling interval
TS = 1 ; % Editable
Tspan = 0:TS:180; % The maximum time is editable
Dt = 0 ; % Deadtime is editable
% Specify the maximum change or gain
Hmax = -0.04 ;
a0 = K0i(1);
if a0 == 0
K0 = K0a;
else
K0 = K0i;
end
% =================
LB = [0.05 1]; % lower limit
UB = [10 50]; % upper limit
A = []; B = []; Aeq = []; Beq = [];
%
alg1 = 'interior-point' ;
alg2 = 'sqp' ;
option = optimset('display','iter','MaxFunEvals',4000,'TolFun', ...
1e-4,'algorithm',alg1);
%
[K,J,eflag ] = fmincon(@cost,K0,A,B,Aeq,Beq,LB,UB,[],option);
% ------------------------------------------------------------------
function J = cost(K)
%
% Predict C/C0 profile
[y,t] = SFOdyns(K,Hmax,Tspan,Dt);
%
n = length(T);
%
for i = 1:n
% Square Error of prediction
Ex(i) = ((Xe(1) + y( floor(T(i)/TS+1) ) - Xe(i) )/(1 - 0.5*Xe(i) ) )^2;
end
J = sum(Ex);
end
% -------------------------------------------
%
[y,t] = SFOdyns(K,Hmax,Tspan,Dt);
%
n = length(T);
Xave = mean(Xe);
for i = 1:n
Jsse(i) = ( (Xe(1)+ y(floor(T(i)/TS+1) ) - Xe(i) ) )^2;
Jave (i) = ( Xe(i) - Xave )^2;
end
% Least square fitness
Rst = 1 - sum(Jsse)/sum(Jave);
%
m = length(y);
Iy = Xe(1)*ones(m,1);
Y = Iy+y;
plot(t,Y,'m',T,Xe,'bo','linewidth',2);
xlabel('Time [min]');
ylabel('C/Co');
% Model paremeters
[Tp,Tb,q] = paraSFOmodel(K);
Kp = Hmax;
%
end
% END