Actually, it does change. It just doesn’t change very much.
Run this:
Tvct = linspace(0,33);
Kdv = [0.95 1 1.05]*Kd;
for k1 = 1:3
Kd = Kdv(k1);
PhsKnsKnt = @(T, P) [Synth - vd*P(2)*(P(1)/(Kd+P(1))) - kdd*P(1); P(3)*VM3*((1-P(2))/(K3+(1-P(2)))) - V4*(P(2)/(K4+P(2))); VM1*(P(1)/(Kc+P(1)))*((1-P(3))/(K1+(1-P(3)))) - V2*(P(3)/(K2+P(3)))];
[T P] = ode45(PhsKnsKnt, [Tvct], [0.01; 0.01; 0.01]);
CXM(:,:,k1) = P;
end
Csq = squeeze(CXM(:,1,:));
Csqr = [Csq(:,1)./Csq(:,2) Csq(:,3)./Csq(:,2)];
Csqd = [Csq(:,1)-Csq(:,2) Csq(:,3)-Csq(:,2)];
I put in Tvct to be sure the function was evaluated at the same time points (since the ode solvers are adaptive). I created Csq, a matrix of the three runs for C(t) with values for Kd varying from 0.95 to 1.05, and then calculated the ratios of them in Csqr. Csqd are the differences, since that may be what you want.
(I put up a transient earlier post about sensitivity functions. That works, but only on actual objective functions. I forgot for a minute that this is a DE. Doesn’t apply to DEs.)
Best Answer