フィルターのクリア

Nonlinear system of equations with constrains

1 回表示 (過去 30 日間)
Mohammad Monfared
Mohammad Monfared 2013 年 10 月 6 日
コメント済み: Matt J 2013 年 10 月 6 日
Hi every body,
I have 4 nonlinear equations and 4 unknowns to be solved. but my unknowns are constrained. So I can't use something like fsolve. Which function do I need to use? I also have optimization toolbox. Is 'fgoalattain' my answer?(I've tried it but not familiar how it works:( )
thanx

採用された回答

Matt J
Matt J 2013 年 10 月 6 日
編集済み: Matt J 2013 年 10 月 6 日
If the constraints are simple upper and lower bounds, you can use lsqnonlin(). Otherwise, you could use fmincon().
  2 件のコメント
Mohammad Monfared
Mohammad Monfared 2013 年 10 月 6 日
Thanks for your reply,
I've tried 'lsqnonlin' but all of the results are not satisfactory. While 3 of my equations are acceptably solved, there is one which is not. The problem with 'lsqnonlin' is that it doesn't minimize(solve) each equation separately but minimizes (f1(x)+f2(x)+...).
I feel I need something to control each equation separately.
The objective function for 'fmincon', should return a scalar (like (f1(x)+f2(x)+...) ) not a vector.
Matt J
Matt J 2013 年 10 月 6 日
編集済み: Matt J 2013 年 10 月 6 日
The problem with 'lsqnonlin' is that it doesn't minimize(solve) each equation separately but minimizes (f1(x)+f2(x)+...).
No, that isn't to be viewed as a problem. If the system of equations possesses a simultaneous solution then that solution must globally minimize the sum of squares (f1(x)+f2(x)+...), bringing it to a minimum value of zero. Similar remarks apply to fmincon.
If you're not getting the results you want it is likely because of one or more of the following,
  1. You have coded your objective function incorrectly
  2. You have given a bad initial guess x0
  3. Your system does not have a simultaneous solution. You must relax your requirements and accept a least squares solution in that case.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver 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