Solve nlp equation system with variables spanning more than 40 powers of 10

12 ビュー (過去 30 日間)
Ane López Sualdea
Ane López Sualdea 2024 年 11 月 20 日 12:02
編集済み: John D'Errico 2024 年 11 月 20 日 13:05
I have a nonlinear system of equations in which the different variables have a difference of 40 powers of 10.
If I pose the system of equations without any modification, fsolve is not able to obtain a result: “No solution found. fsolve stopped because the problem appears to be locally singular.”
I have tried to manually rescale the variables, but I was wondering if there is a more sophisticated solution.

回答 (1 件)

John D'Errico
John D'Errico 2024 年 11 月 20 日 12:59
編集済み: John D'Errico 2024 年 11 月 20 日 13:05
Are the variables potentially going to vary by that many powers of 10? If so, then you would have the solver work in a log space, only exponentiating them inside the objective. As far as the solver is ocncerned, it sees only the log, and so the variables do not vary by much at all.
But, re-reading your question, it seems more likely that your different variables are just scaled poorly, some of which are hugely larger or smaller in their characteristic values than the others. In this case, the only solution is to scale them yourself. That you failed in this just means you did not do it well. We can't really know what you did wrong.
Effectively, it just means that some variables have units in very different systems, some in nanometers, some in light years. You need to use a proper set of units, where all variables are of a similar order of magnitude.
If you want better help, then you will need to show your code.

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by