Multi-variable minimization

Hi,
I am trying to find the minimum variables which fits the function f(x)=0. I tried to use fmincon and fminsearch to find the minimum values of the variables. But the values I am getting are not consistent.
Is there any other way to get the estimation of the values which fit the equation.
f(x)=gx-((gm-x(1))/(gm*x(2)-x(3)) where gx and gm are known values and i need to estimate the min(x) which gives the function f(x)=0.

1 件のコメント

Jarrod Rivituso
Jarrod Rivituso 2011 年 4 月 19 日
Could you share with us the code you are using with fmincon or fminsearch?

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

回答 (1 件)

Matt Tearle
Matt Tearle 2011 年 4 月 19 日

0 投票

What do you mean by "the minimum variables"? x is a vector, so what are you trying to minimize? All the x values? The norm of x, under some metric?
This works for me:
g = @(x) norm(x,Inf);
fmincon(g,rand(3,1),[],[],[],[],[],[],@fcnstrnt,optimset('Algorithm','interior-point'))
And fcnstrnt.m:
function [foo,ceq] = fcnstrnt(x)
gx = pi;
gm = 4.2;
ceq = gx-(gm-x(1))/(gm*x(2)-x(3));
foo = -1; % No inequality constraints on x

カテゴリ

ヘルプ センター および File ExchangeNonlinear Optimization についてさらに検索

タグ

質問済み:

2011 年 4 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by