Constrained optimization of a vector

3 views (last 30 days)
I am trying to optimize a vector. I want to find , where ()=0, and .
f_1 and f-2 are two procedural functions, stored in m-files (not straight-forward functions).
How can I do it with a viable (time-effective) algorithm?

Accepted Answer

Walter Roberson
Walter Roberson on 24 May 2022
Use fmincon. Make the objective f1^2 and use a nonlinear equality constraint with f2.
Walter Roberson
Walter Roberson on 25 May 2022
It depends what the calculations do. In particular, are there analytic forms of the jacobian? Possibly a sparse form? fmincon needs to estimate the gradient of every variable against every other variable, and if you have hundreds of variables that can get slow.

Sign in to comment.

More Answers (1)

Matt J
Matt J on 24 May 2022
Edited: Matt J on 24 May 2022
You have two equations so, as long as numel(a)=2 and f1 and f2 are differentiable, you can use fsolve. If numel(a)>2 then you have more unknowns than equations and the problem is ill-posed.
  1 Comment
mahdi Izadi
mahdi Izadi on 25 May 2022
Dear Matt;
I believe I explained a bit unclear. The problem is somehow OK, as I think the solution proposed above adressed this problem.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!