MATLAB: Please help a student: How can you estimate these 5 parameters by using nonlinear least squares

chemical engineeringcivil engineeringengineeringenviormental engineeringkinetic modelMATLABnonlinearnonlinear least squaresnonlinear regressionParallel Computing Toolboxparameterparameter estimationSimulink Parameter Estimation

For following kinetic model, I've got to estimate: "K0", "E", "Ka", "Kf" and "Kg", and I have experimental data for: rA, Na, Nb, Nc, Nd, Kp, and T. I tried some methods, including a levenberg-marquardt function but they didn't work. This was the first thing that I tried:
% p(1) = K0
% p(2) = E
% p(3) = Ka
% p(4) = Kf
% p(5) = Kg
rA = [15×1 double];
Na = [15×1 double];
Nb = [15×1 double];
Nc = [15×1 double];
Nd = [15×1 double];
Kp = [15×1 double];
T = [15×1 double];
R = 8.314
fun = @(p)((p(1).*exp(-p(2)./(8.314.*T))).*(Na-((((Nc.^2)).*(Nd).^6)./(Kp.* (Nb).^3)))./(1+p(3).*Na+(p(4).*Nc.*Nd.^3./Nb)+(p(5).*Nc.*(Nd^3)/((Nb.^2)))).^2)-rA;
p0 = [100,10,250,200,5,1];
options.Algorithm = 'levenberg-marquardt';
p = lsqnonlin(fun,p0,[],[],[],[],[],options)
Just started my first matlab basic course, I apologize for the mistakes. Any help would be really appreciated!

Best Answer

1. p0 has 6 elements, but you only use 5 paramters. This should be modified.
2. In the last term of the denominator, replace Nd^3 by Nd.^3 and /((Nb.^2)) by ./((Nb.^2))
If you still receive an error message, please post it.
Best wishes
Torsten.