필터 지우기
필터 지우기

use fsolve with boundaries

조회 수: 85 (최근 30일)
Franziska
Franziska 2013년 1월 22일
Hi,
I wonder if there is a way to use fsolve with boundaries?
I am currently using fsolve for a system of nonlinear equations solving for up to 100 variables. The values I get are ok, but unfortunately not in the bounds I want to look. Is there a way to bound the variables?
Thanks a lot.

채택된 답변

Matt J
Matt J 2013년 1월 22일
LSQNONLIN is basically an extension of FSOLVE that allows for upper and lower bounds.
  댓글 수: 3
Matt J
Matt J 2013년 1월 22일
편집: Matt J 2013년 1월 22일
Yes, clearly each requires different algorithms since FSOLVE addresses unconstrained non-linear least squares while LSQNONLIN addresses constrained nonlinear least squares.
However, surely LSQNONLIN might do better than FMINCON, since FMINCON knows nothing about the least squares structure of the problem at all. Otherwise, why not just use FMINCON for everything?
Shashank Prasanna
Shashank Prasanna 2013년 1월 22일
Other than dogleg, FSOLVE and LSQNONLIN use the same algorithm and are only different in the sense that FSOLVE performs the sum of squares internally. FSOLVE just does not have an interface for constraints but the algorithm is capable of it, in which case the user may revert to LSQNONLIN.
FMINCON was just a suggestion, and as you noted, not the best in this scenario, but my comment was about comparing LSQNONLIN to FSOLVE in-terms of one being an extension of the other.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Shashank Prasanna
Shashank Prasanna 2013년 1월 22일
Unfortunately as you mentioned FSOLVE does not do constraints as of currently. As an alternative and with no guarantees as always, you can try to use FMINCON with constraints such that it minimizes the |F(x)| in a least square sense there by forcing each equation to zero. Your mileage may vary.

Franziska
Franziska 2013년 1월 23일
Thanks. - LSQNONLIN works perfect.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by