94.77333333 93.73333333 0.400145927 0.27701074 0.107176434 0.158130584 0.000505722
84.48 88.87333333 0.604820791 0.42039699 0.148464431 0.359954181 0.001077632
73.91333333 83.23333333 0.589530533 0.461026019 0.17071451 0.508774341 0.001205872
68.80666667 76.43333333 0.529979 0.48559649 0.180350987 0.635601375 0.001720902
63.56666667 73.92 0.502282172 0.52315421 0.198918834 0.700114548 0.002064255
59.76666667 70.59333333 0.478273783 0.574401193 0.207380132 0.845269187 0.002895749
theta0 = [rand(11,1)*1E-3; c(1,:).'];
[theta,Rsdnrm,Rsd,ExFlg,OptmInfo,Lmda,Jmat]=lsqcurvefit(@kinetics,theta0,t,c,zeros(size(theta0)));
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to
its initial value is less than the value of the function tolerance.
fprintf(1,'\tRate Constants:\n')
fprintf(1, '\t\tTheta(%2d) = %8.5f\n', k1, theta(k1))
end
Theta( 1) = 0.00256
Theta( 2) = 0.00146
Theta( 3) = 0.00056
Theta( 4) = 0.00230
Theta( 5) = 0.00094
Theta( 6) = 0.00000
Theta( 7) = 0.00000
Theta( 8) = 0.00000
Theta( 9) = 0.00005
Theta(10) = 2.86843
Theta(11) = 0.04557
Theta(12) = 101.54545
Theta(13) = 100.16133
Theta(14) = 0.00000
Theta(15) = 0.00000
Theta(16) = 0.00036
Theta(17) = 0.00000
Theta(18) = 0.00000
tv = linspace(min(t), max(t));
Cfit = kinetics(theta, tv);
hd(k1).MarkerFaceColor = CV(k1,:);
hlp(k1).Color = CV(k1,:);
legend(hlp, 'c(1)', 'c(2)', 'c(3)', 'c(4)', 'c(5)','c(6)','c(7)', 'Location','best');
plot(t,c(:,k),'bp', 'MarkerFaceColor','b')
function C=kinetics(theta,t)
[T,Cv]=ode45(@DifEq,t,c0);
dcdt(1)=-theta(1)*c(1)-theta(2)*c(1)-theta(3)*c(1)-theta(9)*c(1)*c(2);
dcdt(2)=-theta(4)*c(2)*c(3)-theta(5)*c(2)*c(4)-theta(6)*c(2)*c(3)-theta(7)*c(2)*c(4)-theta(8)*c(2)-theta(9)*c(2)*c(1);
dcdt(3)= theta(2)*c(1)-theta(4)*c(2)*c(3)-theta(6)*c(2)*c(3);
dcdt(4)= theta(3)*c(1)-theta(5)*c(2)*c(4)-theta(7)*c(2)*c(4);
dcdt(5)= theta(4)*c(2)*c(3)-theta(10)*c(5)+theta(9)*c(2)*c(1);
dcdt(6)= theta(5)*c(2)*c(4)-theta(11)*c(6);
dcdt(7)= theta(6)*c(2)*c(3)+theta(7)*c(2)*c(4)+theta(8)*c(2);