forum.alglib.net

ALGLIB forum
It is currently Wed Sep 28, 2022 4:12 pm

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  [ 6 posts ] 
Author Message
 Post subject: Boundary constraints for nleq
PostPosted: Fri Mar 22, 2013 1:55 pm 
Offline

Joined: Fri Mar 22, 2013 1:47 pm
Posts: 4
Hi,

I'm trying to solve a system of nonlinear equations with nleq function of alglib (C#). Variables for the system are some concentrations so I need to set boundary constraints to limit their values from 0 to 1, but i cant find how to do this using nleq-class functions. Is there any possible way to implement this?

Thanks.


Top
 Profile  
 
 Post subject: Re: Boundary constraints for nleq
PostPosted: Tue Mar 26, 2013 6:27 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 880
Nonlinear solver does not support this feature, unfortunately.


Top
 Profile  
 
 Post subject: Re: Boundary constraints for nleq
PostPosted: Wed Mar 27, 2013 9:01 am 
Offline

Joined: Fri Mar 22, 2013 1:47 pm
Posts: 4
I have an idea to use minlm algorith for Abs values of functions so that I will minimize them to 0. This optimizer has an option to set contraints, but I'm concerned on performance reduce in this method. Is it a reasonable replacement in this situation?


Top
 Profile  
 
 Post subject: Re: Boundary constraints for nleq
PostPosted: Thu Mar 28, 2013 7:55 am 
Offline

Joined: Fri Mar 22, 2013 1:47 pm
Posts: 4
I have one more question.. One of the variables cannot be constrained by a fixed value. This value changes with another variables. How should I avoid this complexity using minlm algorithm? Should I just use some limited value of this variable in function callback, so if function is called with value that cannot be used function return value for currently calculated constrain value? Or make function to just return some +INF value if its called with impossible variables? Or any other idea? Recalculate boundary constraints on each iteration?


Top
 Profile  
 
 Post subject: Re: Boundary constraints for nleq
PostPosted: Thu Mar 28, 2013 1:25 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 880
"one of the variables cannot be constrained by a fixed value. This value changes with another variables."

It is called nonlinear constraint: x>=f(y), and usually you can't use boundary constrained code to solve such problems. You may try one of the variants proposed above by you, but all of them have some pitfalls, either subtle or clearly visible. Say, returning +INF will just force algorithm to stop as soon as it will meet the boundary of the feasible area - to stop at the boundary instead of moving along the boundary.

If you want, you may use Levenberg-Marquardt as underlying optimizer for penalty function / barrier function / Augmented Lagrangian method, it should work for you.


Top
 Profile  
 
 Post subject: Re: Boundary constraints for nleq
PostPosted: Fri Mar 29, 2013 9:37 am 
Offline

Joined: Fri Mar 22, 2013 1:47 pm
Posts: 4
Ok, thank you very much for the answer.
I'll try to understand this penalty function method and determine is it applicable to my case.
Seems like it is the solution. For now I'm just worrying how the function will behave if the answer is very close to the boundary..

Thanks for help anyway.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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