@Tomas
Sorry for late reply. I recommend you to use the function LMFnlsq or LMFnlsq2, that are also in File Exchange. The advantage is that both functions are maintained, while LMFsolve not. Both functions are also more stable and use almost equal data files. As far as any constraines is concerned, they may be solved by introduction of additional "penalty" residual for k-th unknown, say
(x(k)>30)*(x(k)-30)*w,
where w is a suitable weight, the value of which is found by experiment. If you have more troubles, you may send me your data and i'll try to solve it.
Dear Dr. Balda,
I've been trying to implement your code to a calibration problem I have with many variables. 9 fixed and one more for each measurement. I believe it is for this reason that your function has not been giving me consistent results and I end up iterating more than 1000 times. I already defined the funtions I want to minimize(the residuals) but I would like to add a restriction to some of the variables. The restriction would be something like I don't want to allow the absolut value of some of the x's to be greater than 30. How would you go about that?
Hi Bruno,
I tried your function on a large array (eg. 5*5*1000000), it occupies too much memory. It will take at least 5 times memory as the initial data package. And most of the memory cost is to store the sparse indexes. Is there any way to reduce the memory consuming? Thanks!
Cheers,
Xiaodong
Comment only