## Improving the modelling of annual decisions used for optimization

Use this forum to post Vensim related questions.
portak
Junior Member
Posts: 15
Joined: Fri Dec 07, 2018 2:43 pm
Vensim version: DSS

### Improving the modelling of annual decisions used for optimization

Hello,

I model a stylized electrcity market. My aim is to know the optimal investment decisions each year, by using Vensim optimization.

To this end, I define the invesment variable as following, with a specific variable to use each year:

IF THEN ELSE( Time=2020 ,g0 , IF THEN ELSE( Time=2021 ,g1 , IF THEN ELSE
( Time=2022 ,g2 , IF THEN ELSE( Time=2023 ,g3 , IF THEN ELSE( Time=2024 ,g4 , IF THEN ELSE( Time=2025 ,g5 , IF THEN ELSE
( Time=2026 ,g6 , IF THEN ELSE( Time=2027 ,g7 , IF THEN ELSE( Time=2028 ,g8 , IF THEN ELSE( Time=2029 ,g9 , IF THEN ELSE
( Time=2030 ,g10 , IF THEN ELSE( Time=2031 ,g11 , IF THEN ELSE( Time=2032 ,g12 , IF THEN ELSE( Time=2033 ,g13 , IF THEN ELSE
( Time=2034 ,g14 , IF THEN ELSE( Time=2035 ,g15 , IF THEN ELSE( Time=2036 ,g16 , IF THEN ELSE( Time=2037 ,g17 , IF THEN ELSE
( Time=2038 ,g18 , IF THEN ELSE( Time=2039 ,g19 , IF THEN ELSE( Time=2040 ,g20 , IF THEN ELSE( Time=2041 ,g21 , IF THEN ELSE
( Time=2042 ,g22 , IF THEN ELSE( Time=2043 ,g23 , IF THEN ELSE( Time=2044 ,g24 , IF THEN ELSE( Time=2045 ,g25 , IF THEN ELSE
( Time=2046 ,g26 , IF THEN ELSE( Time=2047 ,g27 , IF THEN ELSE( Time=2048 ,g28 , IF THEN ELSE( Time=2049 ,g29 , IF THEN ELSE
( Time=2050 ,g30 , IF THEN ELSE( Time=2051 ,g31 , IF THEN ELSE( Time=2052 ,g32 , IF THEN ELSE( Time=2053 ,g33 , IF THEN ELSE
( Time=2044 ,g34 , IF THEN ELSE( Time=2055 ,g35 , IF THEN ELSE( Time=2056 ,g36 , IF THEN ELSE( Time=2057 ,g37 , IF THEN ELSE
( Time=2058 ,g38 , IF THEN ELSE( Time=2059 ,g39 , g40) ) ) ) ) ) ) ) ) ) ) ) )) )) ) ) ))) ) ) ) ) ) ) ) ) ) ) ) )) ))))))

My quesiton is: is there a more elegant way to do it?
Thank you

tomfid
Posts: 3049
Joined: Wed May 24, 2006 4:54 am

### Re: Improving the modelling of annual decisions used for optimization

There are two options:

1. Replace the IF THEN ELSE structure with a VECTOR LOOKUP over time (I think the sample model for VECTOR LOOKUP illustrates this). Then you will have an array of time points, like
decisionTime : (t1-t10)
with
gValue[decisionTime] = 3.5, 2.4, 1.9, 4.2 ...

You can then specify gValue[decisionTime] in your optimization control file.

2. Similar to the above, make the decision a function of time with something like Legendre polynomials:
https://metasd.com/2018/02/polynomials- ... ion-rules/

3. Replace the ballistic decisions above with a real feedback decision rule. I don't know what this is about, but an example might be:
ordering = expected losses + a*(desired inventory-inventory) + b*(desired pipeline-pipeline)
where a and b are parameters to be optimized and the rest are dynamic variables.

#3 is generally preferable, because (a) it gives you insight into the structure of the problem, and (b) it's robust to uncertainty and different states of the model. The decisions produced by 1 & 2 are fragile - they only work for a single realization of the model. Also, they assume knowledge of the future, which is impossible.

tomfid
Posts: 3049
Joined: Wed May 24, 2006 4:54 am

### Re: Improving the modelling of annual decisions used for optimization

A similar discussion is here:
viewtopic.php?f=2&t=6873

portak
Junior Member
Posts: 15
Joined: Fri Dec 07, 2018 2:43 pm
Vensim version: DSS

### Re: Improving the modelling of annual decisions used for optimization

Hello,

I try to model it with a vector lookup but I have this warning when I run the optimization. "timevalues" is a constant with a normal sub-type.

No usable constant name.
0<=timevalues<=150.
^.
Line 32 of file Opti_Control file_vector.VOC.
Previous errors prevent continuing

What should I do?

Thank you

tomfid
Posts: 3049
Joined: Wed May 24, 2006 4:54 am

### Re: Improving the modelling of annual decisions used for optimization

You need to specify the subscript dimension:
0<=timevalues[timerange]<=150

portak
Junior Member
Posts: 15
Joined: Fri Dec 07, 2018 2:43 pm
Vensim version: DSS

### Re: Improving the modelling of annual decisions used for optimization

Thank you, it works now!

I assume that if I use the same payoff definition file, replace the equation in my first message with an equivalent vector lookup function and update the optimization control file accordingly, I would have the same decisions for a policy optimization. Is it true as an assumption?

tomfid