Re: Constrained Optimization Problem in C



On Jan 2, 1:44 pm, Explore_Imagination <Mr.HassanShab...@xxxxxxxxx>
wrote:
The task is to solve a constrained optimization problem in C.
Computational
Time is of high priority. One approach can be to use ready functions
in a "free ware" Optimization Library (if available). If any one of
you have any idea about such library please inform me. I am dealing
with Constrained Optimization for the first time so please guide me
How I should solve this problem. I will appreciate suggestions from
you.

Find values of x that minimize  f=-x1*x2*x3  and subject to the
constraints:

x1+2*x2+2*x3>0
x1+2*x2+2*x3<72
x2=10

In Matlab it can be solved by:

x0 = [10; 10; 10];    % Starting guess at the solution

A=[];  b=[];  Aeq=[]; beq=[];  lb=[];  ub=[];

[x,fval] = fmincon(@myfun,x0,A,b,Aeq,beq,lb,ub,@(x)constr(x))

%myfun

function f = myfun(x)

f = -x(1)* x(2)* x(3);        %f=-x1*x2*x3

%constr

function [c,ceq]=constr(x)

c(1)=0-(x(1)+2*x(2)+2*x(3));   %x1+2*x2+2*x3>0

c(2)=x(1)+2*x(2)+2*x(3)-72;     %x1+2*x2+2*x3<72

ceq(1)=x(2)-10;                 %x2=10

Hoping to  hear from you guys !!!!

Go here:
http://plato.asu.edu/cgi-bin/htsearch
Type in search window "constrained optimization problem"

You probably wanted news:sci.math.num-analysis because your question
is not about the C language at all.

.



Relevant Pages

  • Re: Constrained Optimization Problem
    ... in a "free ware" Optimization Library. ... with Constrained Optimization for the first time. ... task to write a general constrained solver, ... mixed integer solver or just to solve the given problem ...
    (sci.math.num-analysis)
  • Is This Optimization Objective Function Feasible?
    ... Hi I have been using fmincon for constrained optimization with no ... problems until I increased the complexity of the objective function. ... reconstruct from 180 columns of radon data ...
    (comp.soft-sys.matlab)
  • non convex optimization
    ... I am trying to solve a single objective, constrained optimization ... objective function is not always a convex function of the variables -- ... it is convex for some choice of the optimizing variables and concave ...
    (comp.soft-sys.matlab)
  • Constrained Optimization -fmincon
    ... I'm stuck in an Constrained Optimization problem.. ... using the fmincon function with matrices... ...
    (comp.soft-sys.matlab)