What alternatives can I use for fsolve?

56 ビュー (過去 30 日間)
Manuela Gräfe
Manuela Gräfe 2017 年 5 月 10 日
編集済み: Matt J 2017 年 5 月 10 日
Hello,
currently I am using the fsolve-function to solve non-linear equations.
Sometimes the solver is successful, sometimes not. I am missing the opportunity to set constraint conditions like:
x(1) > x(2) or
x(1) > 0
For example I have 20 unknown values and 20 equations. But there is more than one solution.
Some of the unknowns are time variables and they have a specific order. So t2 can't be negative or smaller than t1.
What other solver is recommend for this?
Thank you.

採用された回答

Matt J
Matt J 2017 年 5 月 10 日
編集済み: Matt J 2017 年 5 月 10 日
If you have constraints that are more complicated than simple bounds, you should be using fmincon rather than fsolve. Basically, if F(x) is the objective you are feeding to fsolve, you would instead use fmincon to minimize norm(F(x))^2 subject to any constraints that you have.

その他の回答 (1 件)

Torsten
Torsten 2017 年 5 月 10 日
If you have a condition x(1)>x(2), you can work with y(1)=x(1) and y(2)=x(1)+x(2)^2 as new variables.
If you have a condition x(1)>0, you can work with y(1)=x(1)^2 as new variable.
Best wishes
Torsten.

カテゴリ

Help Center および File ExchangeNonlinear Optimization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by