Topics about getting started or leveling up as an AIMMS developer. Datalinks, AIMMS language, building apps...
- 618 Topics
- 1,349 Replies
In AIMMS it is possible to read data from both a query, or a selected object (e.g. a view). I was wondering if there is a difference in performance between the two methods if the only goal is to read data.In my case, I am considering reading data from a table valued function because that allows me to filter the data according to several parameters. An alternative is reading from a view, where the parameters would appear in the columns and then used as an ‘Index domain’ when reading the database table in AIMMS.I’m generally interested in performance impact, best practices, and overall trade-offs between alternative data retrieval methods (given a database).
Hi,I would like to save a section of my model to a case using the new data management style “Disk files and Folders” (https://documentation.aimms.com/functionreference/data-management/case-management/casefilesave.html)However I get the following error: I made sure my section is part of AllCaseFileContentTypes, and it does work if i use CaseCommandSaveAs, just not for CaseFileSave (or CaseFileSectionSave), but obviously I don’t want to always manually save it. Could you help me out with this error?
In my model, I am tracking the production date of certain products. It is possible to produce a product at time t, while allocating it to demand on time t+3. However, there is a maximum ‘age’ of a product. For example ‘If a product is older that three days, it cannot be allocated’. Now, given an allocation variable v_Allocate(i_Order, i_AllocationDay, i_Product, i_ProductionDay), indicating the allocation on day i_AllocationDay to order i_Order of i_Product which has production day i_Production day, I would like to restrict the index range to ‘valid’ combinations e.g. production day >= t-3. If I would restrict the index domain on the variable like so:index domain: (i_Order, i_AllocationDay, i_Product, i_ProductionDay) | i_ProductionDay >= i_AllocationDay - 3 Do I still need to add a separate constraint to ensure this production day restriction? In addition: does it make sense to do this in the index domain?
Dear Users, I have designed a MINLP problem and using AOA as solver. The reason I have to use AOA is my problem has goniometric functions and therefore BARON cannot be used. Also, I am using educational license which restrict KNITRO to solve problem over a specific size. When I solve problem using AOA such that it has initial solution (from a small solved network by knitro or AOA), I get final optimal solution in few seconds by AOA. For example, I solve a 4 node network using KNITRO and use this solution to solve 5 node network by AOA and in this way I gradually increase network size and keep getting result by AOA using solution from previous smaller network. This works fine. But, if I want to solve a network with no initial solution, either I get “infeasible solution” (although it has feasible solution in real) or solution time becomes so high and non-stopping (in hours). I have tried setting a bigger value of relative MIP optimality tolerance and MultiStart and increasing the Maximum
Hi, I have a problem with the callback procedure that is called at each iteration but not the last. At each iteration, the callback is called, if the solution violates the constraints, the cuts are generated and added to the model, but in the last iteration the callback is not called at all, so the feasibility is not checked and the optimal solution provided by (cplex or gurobi, I tried both) is in fact infeasible. This is a scheme of the code: GMPRelaxedModel := GMP::Instance::Generate(NoEnergy_per_lazy) ;GMP::Instance::SetCallbackAddLazyConstraint( GMPRelaxedModel, 'Robust_NogoodCut' );GMP::Instance::Solve( GMPRelaxedModel );
One customer recently shared with us a success in reducing a long solve time by 80% with the new functions CreateBlockMatrices and SendToModelSelection available as of version 4.81.1 Could this method help your model solve faster? See details about the case below. We were facing issues with the solve time of this model, especially given the exponential growth of solve time when we solved larger models. Back in January, we started to investigate the cause of the long solve time together with AIMMS. However, the start of this investigation was daunting: no matter what we tried in model reformulation, scaling, different solvers or solver settings, the performance did not significantly improve. We concluded that if all else failed, we could always solve the individual time periods in the model one-by-one (because in fact those time periods are not connected). To efficiently split the generated matrix in smaller independent submatrices, solve them one-by-one, and merge back into one soluti
I need to impose a time limit for AOA and after the time limit is reached, the value of the incumbent is returned.MPOuterApprox::TimeLimit :=500;GMPOuterApprox::IsConvex := 1;GMPOuterApprox::DoOuterApproximation( GMPRO );BestAOA := GMP::Instance::GetObjective( GMPRO ) ;ProgAOA := GMP::Solution::GetProgramStatus( GMPRO, 1 );display BestAOA , ProgAOA; GMP::Instance::Delete( GMPRO ); in the progress window I can see a value to the “best solution” is assigned and the gap is around 30% but when the time limit is reached, the values assigned to BestAOA , and ProgAOA are as follows: bestAOA := na ; progAOA := 'IntermediateInfeasible' ;I appreciate any help in advance.
Hi, I seem to have difficulties with defining the number of decimals when rounding my parameters . The function description tells me I should define a positive integer for defining the number of decimals on the right of the decimal point, but this function gives me a different number of decimals. I use Units of Measurement and I think the ‘internal’ unit is rounded instead of my defined unit for the specific parameter (which differs in order 6 (10^6) ). Do more people encounter this problem?
Dear AIMMS experts, it would be great if there is a working example related to calling AIMMS from python using the latest release REST API.Also, following on other recent python-AIMMS questions here, could you kindly clarify the following questions:is the method of calling AIMMS using 'win32com' in python still valid? (as seen in the office github repo example in 'examples/Functional Examples/Calling AIMMSCOM/RunAIMMS.py ' ? is the previous method of calling python using 'subprocess' module and command line still valid for the recent version of AIMMS ? does the ways of calling AIMMS in python subject to the type of license I have (I have both free and paid academic licenses) ?
Dear community, I am implementing a structure change in my database declaration and keep coming across the error below. It occurs when mapping database columns to variables, using the DatabaseTable function. The change I have made is in adding an index "st”, and the column names in the data source Access Database.The error:The index "uc" present in Ramp_rate(uc, yr, ct) is not present in the previously generated entry (WorkingH2(i, yr, st)) of this read statement. AIMMS generates communication links when they are not explicitly specified between the keywords read/write and from/to. These entries are constructed by considering the column names in the database, the identifier names in the model and/or the database table mapping attribute.The variable Ramp_rate has little connection to the read statement where the error occurs. Has anyone encountered this error before, and do you have an idea what problem this error most likely hints towards? Thank you kindly for your help in advance,Sa
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!
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?
It seems that for an internal function, I have to specify the arguments with index and size? How can I create an internal function to calculate inverse for any matrix? In this case, do I have to use external function? Thanks.
Hello everyone,Could someone please help me look at a way to find the nodal balance equation at a node for inputs having different indices?More explanation: Refer to the diagram below. Assume nodes 1,2, and 3 are set of buses indexed b. Then connecting lines between the buses are Set with index domain (i,j). To find the nodal balance equation at node 2 such that incoming is made equal to outgoing is somehow difficult for me because of difference in indices. For example say node 2, the sinusoidal sine is generator Pg with index b, outgoing arrow is Demand with index b and line flow (LF) indexed (i,j). The index domain (i,j) only shows the sending end bus and the receiving end bus. Hence the nodal balance equation is:Pg(b) = Demand(b) + LF(i,j). How can I find this sum over different indices knowing that number of buses with index b are not equal to the number of line flows?Secondly, the line flow (LF) is made of two characteristics of different indices. the characteristics are Y indexed
Hello, I have linked an SQLite Database with my model and I am trying to import the data present in database to a parameter PXTankAllocation, however, it is not importing and it does not give out any error too. have attached screenshots for your reference. If you will see S5 image, it is a screeshot taken after I have run the procedure readdb.Please help me with this. Thanks.Regards,
Hello, In my simulation that I am trying to solve, I solve two models(Model 1 and Model 2) sequentially. I have a set of constrains that are trying to minimize the magnitude of changes between the variables, i.e. minimize u; where u >= (Variables of model 1 - Variables of model 2); u is the magnitude of the difference between the two variable sets. When I run my simulation on AIMMS, my code snippet results in empty values for the variable u, instead it should contain a numerical value. I have previously run my situation on GAMS software and the algorithm works. Kindly let me know if you need more explanation on my code to help me out, any direction to look into would be much appreciated
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.