Topics about getting started or leveling up as an AIMMS developer. Datalinks, AIMMS language, building apps...
- 557 Topics
- 1,205 Replies
How to add local identifiers to AIMMS procedures and functions created at runtimeTutorial
AIMMS functions and procedures use local identifiers to hold the values of arguments. The model editor functions that form the basis of runtime libraries operate on elements of AllIdentifiersThese functions create, modify, and delete corresponding global identifiers in the model. In other words, they do not operate on local identifiers. This short tutorial by @Chris Kuip teaches you to add local identifiers to AIMMS procedures and functions that are created at runtime.
Finding the smallest coefficient location in the matrix in the Math Program Inspector
HI, Having the Math Program Inspector is one of the great add-ins of AIMMS. One of the features that I really like is the matrix summary, where I can see the smallest and largest coefficients. However, I want to identify which variables and constraints are involved in those smallest or largest coefficients. One way is to look at the matrix graphical representation, but my model is big and I couldn't find those small coefficients. Now I have some e-14 coefficients that cause numerical instabilities. I was thinking to scale my model, but I would like to find the variables and constraints related to this e-14 coefficient. Is there any way to find the smallest or largest coefficients location in the matrix, without looking at the matrix graphical representation?
Error message: The constraint "Balanceinv" without a suffix cannot be used inside the definition of a constraint
Hello community!I’m trying to encode my inventory balance constraint on AIMMS but when I click on “Check and close”, I receive this error message: “The constraint "Balanceinv" without a suffix cannot be used inside the definition of a constraint”.Has anyone experienced this problem before and can help me? I would be very grateful!
Error message: "the scope of index "m" has not been specified"
Hello everyone,I have been using AIMMS for a short time and am still a beginner.When I encode my objective function, the following error message appears : “the scope of index “m” has not been specified”.I have tried several ways to solve this problem but none worked.Has anyone experienced this problem before and can help me? I would be very grateful!
Issue with creating Tables in Database
Hello,I am trying to create Tables in a database using DirectSQL() function. There are 3 scenarions: DirectSQL("DRIVER=SQLite3 ODBC Driver; Database=Output.db","CREATE TABLE April2121 (Field1 INTEGER)"); Here the procedure is succesfully executed DirectSQL("DRIVER=SQLite3 ODBC Driver; Database=Output.db","CREATE TABLE 20210421 (Field1 INTEGER)"); Here it generates an error DirectSQL("DRIVER=SQLite3 ODBC Driver; Database=Output.db",FormatString("CREATE TABLE %s (%s INTEGER)",CurrentDate, Field1)); Here it generates an errorI need to create tables with names taken from string parameter “CurrentDate” and Column Name taken from string parameter “Field1” Current Date string parameter is defined as CurrentToString("%c%y-%m-%d").Could you please tell me where I am going wrong with this? I have attached screenshots for your reference.Thanks.
Error - Asynchronous solver session
Hi.I am trying to solve a large problem in parallel using asynchronous solver sessions. However, I get this error as soon as I start the simulation ‘The number of simultaneous solves by solver 'CPLEX' exceeds the license limit of 1.' I have CPLEX (Full) solver in AIMMS. Is this because I have a personal node locked AIMMS business license? How do I check the number of solver sessions that I can run simultaneously in AIMMS? Is there a way to activate the Parallel CPLEX option? Thanks.
How to report an AIMMS error
We try to make AIMMS as easy to use as possible, but there are times when you’ll run into errors with your model. Here are some tips to report and troubleshoot an error. If you post an error in our community, follow these best practices to get help as swiftly as possible:Indicate your AIMMS version and provide as much context as possible. Share your AIMMS project following these steps, so we can reproduce the issue. Include the reproduction steps in your error report. For example: Open the attached model Run procedure Proc_MyProcedure You should see an error The scope of index "i" has not been specified. Include screenshots in your post.Try searching the community to see if someone else has encountered this error as well. You may find the solution you’re looking for. Thank you for your report! It helps us all
Warning: CPLEX: Q matrix is not positive semi-definite.
HI everyone, so I have to model a problem but when I run the procedure, it tells me: Warning: CPLEX: Q matrix is not positive semi-definite.Warning: Model status 13: Error no solution, Solver status 9: Error: Setup failure (see message window).I have no idea where my mistakes are, that's why I come to ask for your help.so here is my problem :I have 4 variables, X(j,i) and Q(i,l) are non negative and Y(i) and E(i) are binary variablesMy function to minimize is : sum( (j,i), csb(j,i)*X(j,i) ) + sum( (i,l), cbd(i,l)*Q(i,l) ) + sum( i, ce(i)*E(i) ) + sum( i, co(i)*Y(i) )My constraints are: sum(i, X(j,i)*Y(i)) <= capmp(j)sum(l, Q(i,l)) <= capb(i) + 50*E(i)sum(i, Q(i,l)) >= ed(l)8.333*(sum(j, X(j|j="Afyon",i))+sum(j, X(j|j="Konya",i))) + 9.091*sum(j, X(j| j="Import",i)) = sum(l, Q(i,l))sum(i, Y(i|i="Istanbul")) =1sum(i, Y(i|i="Ankara")) =1sum(i, Y(i|i="Izmir")) + sum(i, Y(i|i="Sakarya")) + sum(i, Y(i|i="Adana")) =1sum(i, E(i|i="Izmir")) + sum(i, E(i|i="Sakarya")) + sum(i, E(i|i="Ada
how to read multi-dimensional data from excel
Hi,I want to read data for a parameter P(x,y) from excel file. The parameter is two dimensional.And the data lies in one of the sheet(say Demand) of a excel file(say DataFile). I have tried ReadList but it is not working as the range of x lies in A2:A50 and the range of y lies in E2:E50 and data lies in T2:T50.Help me to read the data with out creating another sheet.
Using Robust Optimization for Diet Problem
GOOD MORNING, I TRY TO ADAPT THE PROBLEM DIET FOR USE IN F&B BUSINESSES. HOW CAN I DO TO ROBUST OPTIMIZATION? FOR EXAMPLE THE COST PER PERSON REASULTS SHOWS IN ‘PEAK’ AND ‘BASE’. I HAVE SEEN THE TWO EXAMPLES OF AIMMS BUT NOT HELP ME. I MEAN THE 'POWER SYSTEM EXPANSION RO' AND 'PRODUCTIONPLANNINGRO'. THANKS
Best LP Bound on different systems
Hi,how is it possible to obtain a worse outcome on a more powerful PC system? Are there solver options which are benefitial for a faster PC system?In my specific case, I run a Mathematical Program (MIP) minimizing a target function. Since the computation effort is quite high, I introduce an Upper Bound to reduce the solution set. However, if I run the identical probelm instance on two systems, the more powerful one is not able to even calculate a Lower Bound. I use CPLEX 20.1. Any idea why this could be or how to configure solver options? Thanks and best regards
Launching and Shutting Down your AIMMS App with Libraries
To properly launch and shut down an AIMMS application, it’s important for a model builder to know the initialization and termination sequence order used by AIMMS. Therefore, in this tutorial, we built a small application to illustrate the order of initialization and termination. There are various other questions a modeler may have regarding the initialization and termination of an app, including:When can you rely on a library to be initialized? How to stop a running application?Check out the How-To by @Chris Kuip and download the sample application to walkthrough the process in detail.
Using the GuardServerSession library for Incident Handling
Thanks to extensive checking and clear reporting of incidents, end-users can often handle several incidents in AIMMS apps themselves. For other incidents, they may need to turn to the specialists in their team who know more about the data and the model. To help these experts facilitate this support, the GuardServerSession library gathers and shares information about the sessions executed by end-users.An overview of this library can be found in our new How-To on Incident Handling, created by @Chris Kuip For more on error handling, check out Chris’ course on AIMMS Academy.
Missing Rows while writing to CSV - CSVPROVIDER
I’m using CSVProvider 188.8.131.52 for writing outputs to CSV. While writing, certain rows are missing in the csv file where the variable values were 0. When checking in AIMMS (right click variable → Data) I see the domain still has that index but empty value (which means it is 0). However, while writing to CSV the index where variable values were 0 is missing. Is it possible to either include a blank row or with values 0 for the index position where the variables were 0 ?
Usage of GMP::Instance::SetMemoryLimit
I’m trying to define a limit to RAM memory available to solve a generated mathematical program. Is this function related to this? I tried code below, but it’s stoping my solve before the time_limit defined, before the the GAP defined and also is not using 24 GB available. And before I changed the code to use gmp functions it was taking more than 11 GB.
How to build a crossroad/ 2 ways
Hi,I want to build a model that can transport stuff from (i to j) directly or by stopping over at facility r.The transportcost (i to r) and (r to j) are cheaper than the direct transport (i to j). Problems:Open(r ) is either 0 or all possible r are opened and the amount is divided up evenlyEven if transportcosts are way lower for the extrastop r than without, the model does never choose to move all products past extrastop r. (capacities are more than enough) (goal is to minimize total cost (fixed cost and transport cost included)Related Constraints:Amount(i,r)+Amount(d,r)<=Demand(i)*OpenRecycling( r) // index (i,d,r) sum(i,Amount(i,r))+sum(d,Amount(d,r))<=Capacity(r)* Open( r) //index (r ) sum(r,Amount(i,r))+sum(r,Amount(d,r))=(Returnrate(i)*(demand(i))) //index (i,r) sum(i,Amount(i,d))<=Capacity(d)*open(d) //index(d) sum(i,Amount(i,d))=sum(r,Amount(d,r)) //index(d) Thanks for your help.I´m more than happy to post my model if that helps
free Academic License
Hello, for a submission I just had to download AIMMS. I have applied for the Academic License to use it. After I received the verification mail, I proceeded exactly as described in the mail. However, I still can't really use AIMMS because I always get the following error message when creating a new project. As soon as I want to open another project, I also get an error message. When I want to implement a new model I can't add new sets, parameters etc. either. Any help is highly appreciated!
Running more than one instances of AIMMS at the same time
Hi, I these days, I realized a new limitation with the new academic license delivery. Before, I was able to run two instances of AIMMS at the same time. However, now I can only run one instance at a time. Here are my two main uses for parallel instances of AIMMS:I am dealing with a quite heavy energy system model that runs around 2 to 20 hours (depending on the level of details). Sometimes I need to run several scenarios for a specific sensitivity analysis. It would be very useful for me if I can run the model on several computers at the same time. Sometimes I want to continue coding in AIMMS while it is running a problem. Would it be possible to run two or more instances of the model at the same time for academia?
example for reading JSON files
I looked into the example of the dex:: library and I tried the DataExchange example. However I still have trouble to get started in my own program. I want to read a JSON file like given in the attachment and use the data in some variables in my AIMMS program. Could someone help me with a simple example program?
Already have an account? Login
Please use your business or academic e-mail address to register
Login to the community
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.