forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 2:02 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  [ 3 posts ] 
Author Message
 Post subject: Solving multiple linear programming problems
PostPosted: Fri Jul 15, 2022 3:26 pm 
Offline

Joined: Fri Jul 15, 2022 2:24 pm
Posts: 3
Hi,

I am trying to solve multiple linear programming problems in a project, each having different constraints, number of variables, etc.

I tried creating multiple minlpstate structures and follow the procedures as mentioned in the basic example (https://www.alglib.net/translator/man/manual.cpp.html#example_minlp_basic) to solve each of them.

This would work if the number of problems is small (around 5 to 10), but eventually an error would occur if more problems are involved, leading to an error message "terminate called after throwing an instance of 'alglib::ap_error' ".

The function minlpsetbc seems to be the culprit of this error (the error would not occur if I did not call the function) but I cannot find the reason behind it. Is there any reference or example code I can refer to for solving this issue?

In the attach files is the source code in question (the function Flow_Based_Market_LP_Set is where things went wrong). The project it is located can be found at https://github.com/TonyYenTWN/trEnD/tree/main/src.


Attachments:
power_market_func.cpp [20.51 KiB]
Downloaded 112 times
Top
 Profile  
 
 Post subject: Re: Solving multiple linear programming problems
PostPosted: Sun Jul 17, 2022 11:22 am 
Offline
Site Admin

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

alglib::ap_error has msg parameter which contains a short description of what happened. Would you like to post it here?


Top
 Profile  
 
 Post subject: Re: Solving multiple linear programming problems
PostPosted: Mon Jul 18, 2022 7:50 am 
Offline

Joined: Fri Jul 15, 2022 2:24 pm
Posts: 3
Sergey.Bochkanov wrote:
Hi!

alglib::ap_error has msg parameter which contains a short description of what happened. Would you like to post it here?


Hi,

Thanks for the advice. After using try/catch I found the error message was "MinLPSetBC: BndU contains NAN or -INF" and identified where I placed invalid boundary for the box constraints.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 58 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group