Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NONLCON as inline object in fmincon?

22 views
Skip to first unread message

Frank Alsmeyer

unread,
Nov 2, 2001, 11:31:21 AM11/2/01
to
Hi,

is it possible to avoid writing the constraints for fmincon into an
m-file? I have a
case where the constraints are automatically created and written to
disk, but sometimes the file system
is not up to date when I call the optimization routine. Therefore I
wondered if
it is possible to use an inline function for the constraints. However,
it looks (to me)
like there is no way of getting two output arguments (C[] and Ceq[])
out an inline function.


I would be grateful for any suggestions.


- Frank


Mary Ann Branch

unread,
Nov 6, 2001, 11:24:36 AM11/6/01
to

You are correct, inline functions only return one element.

How about you write 2 inline functions, one to return C and one for CEQ.
Then you can write a m-file that when passed the inline functions
returns both C and CEQ.

Pass the 2 inline functions to FMINCON via the "extra arguments" syntax
(see below) after the "options" argument.
Unfortunately, your objective function will also need to "accept" these
2 extra arguments even though you won't probably need them there.

computeC = inline(......);
computeCEQ = inline(........);
xout ...
= fmincon(FUN,X,A,B,Aeq,Beq,LB,UB,NONLCON,options,computeC,computeCEQ)

Will this work for you?


-- Mary Ann

In article <3BE2CA59...@lfpt.rwth-aachen.de>, alsm...@lfpt.rwth-
aachen.de says...

0 new messages