Dear All,
I want to write an equation for calculating growth in a parameter or variable. As an example:
Pop(t) = Pop(t-1) + GrowthFactor(t)*Pop(t-1)
How to do this inside AIMMS?
Thank you.
Dear All,
I want to write an equation for calculating growth in a parameter or variable. As an example:
Pop(t) = Pop(t-1) + GrowthFactor(t)*Pop(t-1)
How to do this inside AIMMS?
Thank you.
Hi,
Parameter
I tried using this approach and it worked
Code (remark: PRD → t):
popini $ (Ord(PRD) = 1)
+ pop(PRD-1) $ (Ord(PRD) > 1)
+ growthFactor(PRD) * pop(PRD-1) $ (Ord(PRD) > 1)
where popini is your initial value.
Variable
Similar to parameter. You can create a constraint as shown below:
Code (remark: PRD → t):
vPop(PRD)
=
popini $ (Ord(PRD) = 1)
+ vPop(PRD-1) $ (Ord(PRD) > 1)
+ growthFactor(PRD) * vPop(PRD-1) $ (Ord(PRD) > 1)
where popini is your initial value.
Hope this helps!
Hello
Thank you very much for the advice given.
One more question, is there any difference between using "$" and "|" in writing formulas in parameters or variables?
Hello
Thank you very much for the advice given.
One more question, is there any difference between using "$" and "|" in writing formulas in parameters or variables?
Hi,
Great question. I wasn’t able to find exactly, for all cases, the difference between “$” and “|”.
I know they are similar when we are calculating or using functions, as mentioned in this page:
https://documentation.aimms.com/language-reference/sparse-execution/the-aimms-sparse-execution-engine/modifying-the-sparsity.html
In the documentation above “$” is a sparsity operator, but in some cases “$” means ONLYIF, like in the code that I worte in this topic. I know also that only “|” can be used to define domains.
AIMMS compiler is evolving, maybe
Thank you very much...
Already have an account? Login
Please use your business or academic e-mail address to register
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Didn't find what you were looking for? Try searching on our documentation pages: