Parameters estimation using lsqcurvefit

1 view (last 30 days)
Hi I am trying to do parameter estimation following the code prepared by Star Strider ‘Igor_Moura'. I have added several differential equations and edited the code. But it does not run. I would really appreciate it if you would help me to solve my problem. Thank you.
Always I receive the following message : Failure in initial user-supplied objective function evaluation. LSQCURVEFIT cannot
continue.
Attached the script
Please help

Accepted Answer

Star Strider
Star Strider on 14 Apr 2021
I did not see this originally, or I would have responded to it several days ago.
The code needed some tweaks (that I will let you find, referring to the ‘Igor-Moura.m’ code will make this easier). I attached it here. It now runs, and produces:
Rate Constants:
p(1) = 5.09562
p(2) = 0.02642
p(3) = 3.25429
p(4) = -0.28403
p(5) = 1.06602
p(6) = 16.32329
p(7) = 0.20617
p(8) = 3.98434
p(9) = 1.38866
p(10) = 4.19445
p(11) = -5.18517
p(12) = 0.05000
p(13) = 0.67375
p(14) = 0.22527
p(15) = -0.22388
p(16) = 12.31547
p(17) = 14.00000
p(18) = -5.37072
p(19) = 79.89868
p(20) = -0.27531
p(21) = 19.43315
p(22) = 0.88034
p(23) = 20.60852
p(24) = 2.81029
p(25) = -0.48154
p(26) = 3.54883
p(27) = 0.07324
p(28) = 2.13279
p(29) = 1.30150
p(30) = 0.24330
p(31) = 121.96400
p(32) = 2.20000
p(33) = 2.20000
Adding:
for k = 1:size(yexp,2)
subplot(8,2,k)
plot(t, yexp(:,k), 'p')
hold on
plot(tv, yfit(:,k), '-r')
hold off
title(sprintf('Column %2d',k))
end
after the ‘yfit’ assignment demonstrates that the fit is not close, however now that the code runs, you can work on fixing it so that it produces better results.
  4 Comments
Mouna YAHYA
Mouna YAHYA on 15 Apr 2021
okay I will see thank you for your answer

Sign in to comment.

More Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!