using fminsearch to optimization two parameters which depend on each other
조회 수: 5 (최근 30일)
이전 댓글 표시
hi everybody, my question about optimization with MATLAB's "fminsearch" function, in order to find out actual model parameters that give appropriate simulation results compare to measured data, in my mfile I created an "error" variable which is square of difference between simulation result and measured data, so fminsearch gives satisfactory results which minimize variable "error" and helps to parametrize module well. But in one case I don't have 1st hour of measured data, and the model parameter that I want to find out (function of time) is also depends on initial value, for that reason I could not get any fit results, here e.g. as initial voltage (before one hour) is not known the result of optimization gives an initial voltage value is so high and parameter (resistor) that I am looking for is too low, any idea will appreciated, thanks in advance
댓글 수: 0
채택된 답변
Matt J
2014년 2월 14일
편집: Matt J
2014년 2월 14일
Do you have any more sophisticated solvers, e.g., from the Optimization Toolbox? If so, the natural thing would be to impose optimization constraints on how the curve behaves in the first hour.
If you only have fminsearch, a poor man's solution would be to add a penalty on behavior that you consider bad. For example, you said the current fit is too high, so you could do
fminsearch(@(p)norm(f(x,p)-y)+beta*(f(1,p)) )
This will discourage large values of f(x,p) at x=1, where beta>=0 is a tuning parameter.
댓글 수: 2
Matt J
2014년 2월 14일
편집: Matt J
2014년 2월 14일
But clearly there are things you know about the shape of the curve even in the extrapolation region, where you have missing data. Otherwise, how would you know that the unconstrained fit values are "too high" there, to use your words.
You might have a look at this
It lets you fit curves with all kinds of condition on shape. The curve is a spline fit, but you might be able to use it to extrapolate/fill in the missing data. Then you can re-run the fit with any model you want and with no missing data.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!