Thank you very much for your patience and your helpful suggestions.
We are here again, because we are not sure about how the procedure works.
Following your on line example, we made something similar in C#.
But it seems that the algorithm not always converge, so we would like your opinion.
In the attached test, we have a set of measures, our y values.
We have inputted also initial values very near the solutions (that in this specific case we know), so we expect that the algorithm converges to something close as result.
What we obtain is a very far solution, and in many cases it never exit from the main loop.
We have tried with many Trust Region Size (rs parameter in dtrnlspbc_init) but nothing changed.
Could you help us?
Our value of the functional is:
F[i] = y – f(x) = measured value - calculated value.
Is it correct?
Sometime we noted that if:
F[i] = ((measured value - calculated value) / measured value)^2
Trust region method works well.
Why this differences?
Moreover (and maybe this is the crucial question), we noted that if a minimum = 0 exist and then all F[i] = 0, the algorithm works perfectly.
Vice versa, if minimum > 0 the algorithm in the tested cases does not work, as already said.
See attached draft.
Finally consider that, we know that in our case, Jacobian matrix coefficients cannot be calculate in a very precise way because the calculated value function is an infinite integrals calculated in a numerical way, but if this could be a problem, it will be a problem also when minimum = 0 exist.
thank you very much
Gianluca