Using Fminsearch to fit two functions recursively
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi Matlab community,
I am trying to fit this xdata and ydata with Fminsearchbnd to extract 4 parameters using the following functions (see attached document)
Function 1: psi = [(Kf + Kb)Ro' - Kb] * exp(-Kf-Kb)
Function 2: Ro'' = (psi + Kb) / (Kf + Kb)
where
psi = ydata / (2*96485*0.045*0.2e-12 / 0.0083)
Kf = Ko * exp(-alpha*((2*96485)/(8.314*298))*(xdata-Enot))
Kb = Ko * exp((1-alpha)*((2*96485)/(8.314*298))*(xdata-Enot))
Ro' is at t = 0 and Ro'' is at t + 0.00833 and are interlinked with this equation Ro' = Ro / 0.2e-12 or Ro'' = Ro / 0.2e-12.
The initial guesses for Ko, alpha, Ro and Enot are: 0.1 (range between 1e-6 to 1e5), 0.5 (range between 0.3 to 0.7), 1 (no range) and -0.26 (range from -0.35 to -0.15), respectively.
Each function should be used recursively at each xdata point and how can I incorporate the second function?
So far, I have been able to fit the first point but it is not following and the initial guesses appear to influence the outcome of the fit...
Any help would be greatly appreciated!
Thanks!

댓글 수: 9
jgg
2016년 4월 26일
It depends on your problem; if you have a pretty good idea where your solution should be, fminsearch is probably good enough. Otherwise, you can try ga the genetic algorithm or patternsearch if you have those toolboxes. Otherwise, it's best to just test a lot of starting points.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Least Squares에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

