How is f(x) evaluated for each iteration using fsolve?
조회 수: 9 (최근 30일)
이전 댓글 표시
I'm using fsolve for an unconstrained non-linear function. And I notice that fval is much different than f(x) for the last iteration. How exactly is f(x) calculated?
댓글 수: 13
채택된 답변
Martijn
2019년 1월 15일
The values shown under f(x) in the iteration table are indeed not literally the function values at that given iteration, you are seeing the square of the norm of the function value vector here; as documented, see:
The reason for this is that "fsolve" can actually solve whole systems of equations where f(x) would then be a whole vector of values. Displaying this whole vector in the table is not really feasible, there is not enough space for that. Hence, instead, a measure is shown which basically summarizes the whole f(x) vector in a single measure which also actually is representative for how good the current solution is.
We could look into whether we can perhaps change the header to ||f(x)||^2 in future releases to better illustrate this.
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!