forum.alglib.net

ALGLIB forum
It is currently Sun Jun 23, 2024 2:37 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Nonlinear Constraint Optimization Confusion
PostPosted: Mon Jun 03, 2024 6:51 pm 
Offline

Joined: Mon Jun 03, 2024 6:37 pm
Posts: 1
Hello,

I am trying to do optimization with nonlinear constraints where an algebraic representation of the function is unknown (every time it calls the function, it triggers a physical process with the given input and measurement of this process). I am trying to use the following two functions in C++, as I don't think I can get a Jacobian in this case:

void minnlcsetnlc(minnlcstate &state, const ae_int_t nlec, const ae_int_t nlic, const xparams _xparams = alglib::xdefault);


and


void minnlcoptimize(minnlcstate &state,
void (*fvec)(const real_1d_array &x, real_1d_array &fi, void *ptr),
void (*rep)(const real_1d_array &x, double func, void *ptr) = NULL,
void *ptr = NULL,
const xparams _xparams = alglib::xdefault);


However, I do not see where I can put in my nonlinear constraints in minnlcsetnlc, or anywhere in minnlcoptimize for a callback for the nonlinear constraints. How do I specify the nonlinear constraints?

Thanks for your help


Top
 Profile  
 
 Post subject: Re: Nonlinear Constraint Optimization Confusion
PostPosted: Tue Jun 04, 2024 12:29 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 918
Hi!

The minnlcsetnlc/minnlcsetnlc2 pair of functions does not accept constraints themselves, merely their count and bounds/types. You should pass constraint callbacks as a part of the problem Jacobian or function vector. The first vector component / Jacobian row is an objective, the rest are constraints.

If your problem has no derivatives available, you can use numerical differentiation optimizer mode, minnlccreatef(). However, you problem is likely to be expensive to evaluate, given what you said about performing some real-world measurements every time you want to evaluate the function. ALGLIB will still work, but probably it may take too much time because every gradient evaluation means 4N physical measurements to perform.

There are other approaches, like building an RBF model of the function every time you perform a measurement, and optimize that model to determine where to evaluate the target. It allows to save a lot of time. However, presently ALGLIB does not support it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group