Topics about getting started or leveling up as an AIMMS developer. Datalinks, AIMMS language, building apps...
- 555 Topics
- 1,205 Replies
Supply Chain Optimization Warning: Duplicate row errors leading to non-unique shadow prices
Hi! I’m doing a supply chain optimization using AIMMS for my master project and I have a problem with my binary determinant variable as well as the result error computed. Since this is my first time using AIMMS, I am not sure on how to debug it.The constraint of my binary is X(i,l,g,g2) + X(i,l,g2,g) ; where g≠g2.After I run the program, it saysWarning: The rows "TransportationBinary(liquid hydrogen,truck,g1,g3)" and "TransportationBinary(liquid hydrogen,truck,g3,g1)" are equal in the generated mathematical program "MinimizeDailyCost". This may lead to non-unique shadow prices. For more information regarding potential causes and consequences, see the help associated with the option "Warning_duplicate_row". Can anyone help me explain what is the problem? I am also confuse on which section to declare the g≠g2 in the transportation constraint (g represents the grid squares/ supply demand location).Appreciate your help!
Subsets from Excel
Hello AIMMS community!I currently working with aimms on my thesis and for my model i need the MainExecution read a huge amount of sets and parameters. For that I’m using Excel-Sheets. I also going to need subsets and here is my, i think, for you, very simple question:How can I exclude Excel cells from being readed? For example one of my sets is readed asSpreadsheet::RetrieveSet ( WorkbookName, facilities, "A4:A75");If now a subset of facilities is not contigious in this column A4:A75 but instead maybe the cells A10 to A15 and A20 to A30 and A50. How would i retrieve this subset? I tried this (see below) and many other variants and nothing worked. Hope you can help me. Spreadsheet::RetrieveSet ( WorkbookName, facilities, "A10:A15+A20:A30+A50");
Problem in giving a min. value to my index
Hello everyone, In the problem that I have to solve, I have got two sets: j (=1, …, 5) and k (=1, …, 9). I also have a parameter: parameter(j,k) and I want that j begins from 2 (and not from 1) for this parameter. How do I put it in AIMMS? Moreover, in my objective function I want to minimize the sum of my costs but for j >= 2. My current formula looks like this: sum[j, 200*W(j)] with W(j) a variableHow do I specify that I want j to be larger or equal than 2? Thank you
Demo impressions 1/4/2022
Running late on this one! Even if it was a while back, I think there were interesting things going on. We have been working on a new compilar. We are not done yet (no changes to product as of yet), but progress has been made. When this is done, it opens up possibilities for innovations in the use of the AIMMS language. Combination chart! How this grows! We now allow you to specify an interval for the X-axis label. Nice to clean up label-heavy axis. It is now possible to hide specific indexes from being displayed - which can also make legends and labels less cluttered and more useful. I see two nice use cases: similar to pivoting the identifier label to the totals; hiding auxiliary indexes that shouldn't be shown to end-user. Combination chart on non grid - now you can see that it is incompatible (isn't of just not showing up). Tooltips are now also supported on the Selectionbox, Multiselect and Legend widgets, by using a Tooltip Identifier for the relevant identifier(s) in your mo
Dealing with different data types in the Data Exchange Library
In this How-To article we explain how to implement the usage of the data formats (JSON, XML, CSV, Excel, Parquet) in mapping files and, if applicable, format-specific requirements. This article is part of a How-To series on the DEX. Let us know if you have any questions about using the DEX and/or suggestions for follow-up articles! Go to article: Dealing with different data types in the DEXNew to DEX? Start here!
WebUI: how to save the interface
Hi, I’ve been developing some stuffs using webUI. But, somehow, some part of it (what I did earlier) is still there when I refresh the Chrome while the other part of it is gone whenever I refresh or go to the previous page. How to save the pages and interfaces that we have made in webUI ya? I’m using the latest version of AIMMS (AIMMS 220.127.116.11 64-bit).Thanks,Zulfan
Demo impressions 18/3/2022
Demo time!First off we had a demonstration of the capabilities of Octeract, a global MINLP solver that has been linked to AIMMS. The new options are always great since they can provide alternatives for our clients to pick the best of the breed for each problem. And as such, this solver can be useful for some problems. More on them here:https://octeract.com/ Next was a cool progress update on our Application Management via API Calls. I see great potential for integrating AIMMS in other solution via API's but also integrating CI/CD with this functionality. Finally, @Gertjan shared numbers on the community edition license which is now 1 year old! Check our celebration post here: Share your thoughts!
Community Edition Birthday!
Our AIMMS Community License has completed it's first year! 🎉🎊🎈And we are very happy in the reception that this free edition got by our users.Looking back at the original post, I love the proposed intentions for this release. To quote @Gloria Quintanilla :Whether it’s crafting a plan to reduce your personal carbon footprint, creating a schedule for your kids’ school or simply to learn and experiment, AIMMS Community Edition is ideal for those who want to apply modeling to improve decision making. It’s also a great companion for recent graduates who previously used an AIMMS Academic License but want to continue playing with the software at no cost, or showcase their AIMMS skills to prospective employers. So, what did the community edition do for you? Please share with us!And if you still don't have a license, jump right on:https://licensing.cloud.aimms.com/license/community.htm?utm_source=website&utm_medium=footer
How-to: Manage sub job completion with pro::messaging::WaitForMessages
Waiting for sub jobs to complete For large jobs, it may make sense to split it into multiple jobs. It may not be convenient, or appropriate, to let the client session organize the communication between the various jobs.This article presents and discusses an example, whereby one control job manages several sub jobs. In addition, results are presented in the client session when all jobs are finished. Read more...
how to store solutions in Monte Carlo simulation
Hi, I was trying to play around with Monte Carlo simulation in AIMMS. I can save the results from MP.Objective for every run. But, how can I save the solution for every run? I tried to use something like below for every run:Variable_Result(run, param1, param2) := Variable(param1,param2);It’s in the procedure “RunMonteCarlo” in the attached file. But, it doesn’t work. Any idea?Thanks,Zulfan
How much data can be plotted in Histogram of AIMMS?
Hi, I’ve been trying to run some Monte Carlo simulations, but apparently if the number of runs is more than 500, the Histogram cannot be made. AIMMS returns some arithmetic error that I don’t understand. How can we increase the number of data that Histogram can make?Thanks,Zulfan
Merge Requests in GitLab regularly lead to problems
Hello everyone,in contrast to other programming languages, the source code of an AIMMS model usually is in a single file. Our code is hosted at a GitLab instance. Our team notices, that GitLab struggles with the large .ams-file, especially in merge requests. Sometimes the diff is too large to be shown, posting comments (as a reviewer as part of a code review) fails, or loading already posted comments fails. The size of our .ams-file is usually between 1 MB and 5 MB.Has anyone else experienced similar issues? Does anyone know a good alternative to conduct code reviews, which does not involve hosting the code on a different platform?I’m aware that we could use libraries to divide the code in smaller chunks, however, I feel like this is not as easy as in other programming languages and not the way it’s “supposed to be” in AIMMS.Best regardsBenedikt
PageCopyTableToExcel Procedure - Save Results to Excel
Hello, I want to save the results of various variables into an Excel Workbook. All the results I want to save are on the “Multiple Iteration Dashboard ” Page I created. I read about the function PageCopyTableToExcel that would allow me to save those results (https://documentation.aimms.com/functionreference/user-interface-related-functions/page-functions/pagecopytabletoexcel.html#pagecopytabletoexcel). You can find my projects attached to this question. To do so, I created a Procedure named “ExportExcel” where you can find the following code : if not axll::WorkBookIsOpen(WorkbookFilename : "Book1.xlsx" ) then axll::OpenWorkBook(WorkbookFilename : "Book1.xlsx" );endif; PageCopyTableToExcel(pageName: "Multiple Iteration Dashboard", tag: "FuelEfficiency", includeHeaders: 1, selectionOnly: 0, ExcelWorkbook: "Book1.xlsx", Range: "A1:Z150"); I went into the Fuel Efficiency Table Properties to correctly tag it as “FuelEfficiency”.However, I got t
Substitute for "sumproduct" Function in Excel
Hey Guys,I have a small problem by modeling my MILP.I created a Matrix do define some Binary Variables. Now I want to create a constraint, which contains a multiplication between the Matrix of the Variables an a Matrix with some parameters. The result should be a scalar value comparable to the sumproduct-function in Excel. I want to do a multiplication between the matrices an the result should be a scalar?Hopefully there is a simple function in Aimms to solve my problem.I am thankful for every help!Best regardsSimon
Loop in Main Execution to change a parameter at each iteration
Hello, I want to solve an optimization problem with a minimization of costs. I would like to create a loop that would help me solving the same model but changing only one parameter of my objective function at each iteration. The logic is the following : While (Parameter <= Bound ): Solve Objective_Function(Parameter); Parameter = Parameter + 1; where “Parameter” is the parameter I want to change at each iteration of the loop. where “Bound” is simply a bound to stop my while-loop. where Objective_function is simply the objective function of my problem and depends on the parameter that should change at each iteration. Could you help me? Thank you.
Convert LastUsedColumnNumber to Excel letter-representation
In version 4.71.4, I tried to use the LastUsedColumnNumber, and as the name already gives away it returns a number while I had hoped for a column name in the range of 1 to “ZZZ” like the ones that Excel uses. This would make it easier to also used it in the column/data range definition when reading data.Can anyone advice on how to easily/efficiently translate this?Thanks in advance!
Slow Convergence Leading to Infeasibility
Hi AIMMSians,I have formulated an NLP model with around 2500 variables and it is non-convex. When I solve it using IPOPT, I get the error “Intermediate Infeasible, terminated by solver”. When I use CONOPT as solver, I get same error. Analyzing the listing iteration log files, it reveals that solver labelled the solution as infeasible because the convergence is too slow as demonstrated by message in the end of listing iteration log “Convergence is slow and a derivative is discontinuous”. Please note that sometimes, the same model reached a “local optimal” with sensible values for the variables. With some nice information in AIMMS documentation, forum and webinar, I have tried scaling option, good initial points (which are not possible in every case) and a bit of reformulation by removing some variables acting as intermediate variables between two variables to calculate some values. None of these options have proved any change in the results. Any idea or word is highly appreciated. Thank
How to get ranges for specific values of variables
Hello, everyone！Now I have a problem about how to set ranges for specific values of a variable. I have a variable “Cmatrix(t,x,conv) ” and “t,x,conv” are some sets. I need that Cmatrix(t,x,conv) ∈ [-1,1] only when conv ≠ 'Heat_pump' . And Cmatrix(t,x,conv) >1 only when conv = 'Heat_pump'. How do I write this in the red box? When I set a constraint to bound the “Cmatrix(t,x,conv) ”, there will be errors as “The solver CONOPT 4.1 cannot handle the ranged constraint Cmatrix_except_HP(1,Elec,CHP_engine) in mathematical program "Cost_minimization"; please define the middle term as a variable and add bounds.” Can some kind person save me? Thank you so so so much! Wish you happy every day.
Demo impressions 4/3/2022
New internal demo and here I am to share! Remember what I share here is not (necessarily) released yet and can change or even be discarded! I just give the scoop.Connecting the dots is a new functionality in the combination chart that can allow you to “connect the dots” quite literally! So if you have a line chart and have missing data (for some x values), you can still connect the data that is present.Example of connecting dotsAutomatic conversation of classic charts to new combination chart! I really appreciate the effort into building this functionality making life so much easier, but still maintaining the original chart so you'll always be safe in using this. I also enjoyed the improvement to table filtering explicitly separating regex functionality from others. This is already released: https://documentation.aimms.com/webui/table-widget.html#regular-expressions
Creating Stochastic model from an existing deterministic NLP problem
Hi. Please, I would like to know if it is possible to create a stochastic model from an existing deterministic Non-linear programming problem using AIMMS. I need great help regarding generating scenarios in a multiperiod Optimization problem containing 3 uncertain parameters.Thank you
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.