Using fzero with two conditions

19 ビュー (過去 30 日間)
Ana Carolina da Silva Pacheco
Ana Carolina da Silva Pacheco 2021 年 5 月 17 日
コメント済み: Walter Roberson 2021 年 5 月 18 日
I have a fzero function in which I'm setting an equilibrium equation in terms of a position x, so I can find the value of x. The problem is that I have one more variable as incognita in this equilibrium equation. Also, I have one more equation that could help me. Briefly, I have two equations and two incognitas. I don't know how to write the fzero function in terms of this two equations to find both of the incognitas. Can anybody help me, please?
P.S. my problem requires an interactive procedure.

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 5 月 18 日
fzero() cannot be used with two equations or two unknowns.
fsolve() from the Optimization toolbox can be used.
Also, fminsearch() from basic MATLAB can be used, if you rewrite in terms of the square of the function -- in which case the minima of the square would be when the function was zero. However, it is difficult to use fminsearch() with constraints. But in the File Exchange you can find John D'Errico's fminsearchbnd to do an fminsearch with upper and lower bounds.
  2 件のコメント
Ana Carolina da Silva Pacheco
Ana Carolina da Silva Pacheco 2021 年 5 月 18 日
My problem requires an interactive procedure... I don't know how to use fsolve() in this case.
Walter Roberson
Walter Roberson 2021 年 5 月 18 日
I am not sure what you mean by an "interactive procedure" ?

サインインしてコメントする。

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by