# forum.alglib.net

ALGLIB forum
 It is currently Fri Mar 01, 2024 8:05 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.

 Page 1 of 1 [ 6 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Boundary constraints for nleqPosted: Fri Mar 22, 2013 1:55 pm

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

 Post subject: Re: Boundary constraints for nleqPosted: Tue Mar 26, 2013 6:27 pm

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

Top

 Post subject: Re: Boundary constraints for nleqPosted: Wed Mar 27, 2013 9:01 am

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

 Post subject: Re: Boundary constraints for nleqPosted: Thu Mar 28, 2013 7:55 am

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

 Post subject: Re: Boundary constraints for nleqPosted: Thu Mar 28, 2013 1:25 pm

Joined: Fri May 07, 2010 7:06 am
Posts: 902
"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

 Post subject: Re: Boundary constraints for nleqPosted: Fri Mar 29, 2013 9:37 am

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 6 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 6 guests

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

Search for: