I have a few problem with do nonlinear regression
Show older comments
Hello people, I am trying to do this regression for my thesis, and I have a few problem with this, I will thank you very much if you could help me. this is the script. close all clc
M1 = [0 178 178.89358 0.02754 0 1000 0 93339.41 967.8229 1.998 183.599 183.82803 0.00963 0.01683 354.286 618.96 12089.44 2110.291 3.996 187.174 187.39704 0.00424 0.02059 157.283 763.362 5616.15 3018.238 5.99401 191.111 191.3889 0.00165 0.02086 61.8072 780.123 2745.735 4411.363 7.99201 196.505 196.93473 4.55377E-4 0.0185 17.2355 700.385 1146.763 7323.753 9.99001 206.637 207.69399 4.22855E-5 0.01196 1.63548 462.553 257.8261 18393.6 11.988 223.933 223.94751 6.51074E-11 1.27777E-5 2.60977E-6 0.51218 0.00213 248.1378 13.986 223.952 223.95174 0 0 0 0 4.72213E-4 1.5156E-4 15.984 223.952 223.95175 0 0 0 0 4.72213E-4 1.5156E-4 17.982 223.952 223.95175 0 0 0 0 4.72213E-4 1.5156E-4 19.98 223.952 223.95175 0 0 0 0 4.72213E-4 1.5156E-4]
x1 = [M1(:,4)] x2 = [M1(:,5)] x3 = [ M1(:,3)] xdata = [x1 x2 x3] y1= [M1(:,8)] y2 = [M1(:,9)] ydata = [y1 y2]
x0 = [1.81e+03 , 1.81e+01]
E1= 1.1e+05 R=8314 Tref=448.16 Kaca=6.75e+02 E2=1.69e+05 Tk=273.15
fun = @ (x,xdata) [(((x(1)*exp(-(E1/R)*((1/(xdata(:,3)+Tk))-(1/Tref))))*xdata(:,1))/(1+Kaca*xdata(:,2))) ,(((x(2)*exp(-(E2/R)*((1/(xdata(:,3)+Tk))-(1/Tref)))*(Kaca*xdata(:,2)))/(1+Kaca.*xdata(:,2))))]
x =lsqcurvefit(fun,x0,xdata,ydata)
1 Comment
Star Strider
on 2 Aug 2017
Please be specific:
- What are the problems you are having? (If your code is producing error messages, copy all the red text from the Command Window and paste it to a Comment here.)
- What do you want help with?
Answers (0)
Categories
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!