Optimization  VECTOR LOOKUP and other approaches ?)

 Senior Member
 Posts: 102
 Joined: Wed Oct 25, 2017 3:52 pm
 Vensim version: PRO
Optimization  VECTOR LOOKUP and other approaches ?)
Hello,
I am working on a model which is about the average fuel economy (liter/kilometer) of cars in a stock of cars. The stock has a desired stock level (exogenous). There are 3 types of car representing different combination of price (exogenous) and fuel economy levels (exogenous). Every year, 3 types of cars are bought to supply the stock, and total number of cars bought every year is determined by the inflow of the stock. Annual distance driven by a car is a fixed constant. Average car lifetime is a fixed constant. The period of modelling is from 2018 to 2030.
There is an exogenously defined desired fuel economy level (constant, 7 liter per km per car). So the interest is to explore what would be "optimal" strategy of buying the 3 types of cars per year so that the gap between the "desired fuel economy" and the "average fuel economy of cars in stock" over the period of 2025 to 2030 can be minimized to the extent possible and at the same time the total cost of buying cars per year (throughout 2018 to 2030) can also be minimized to the extent possible.
This is my first time looking at policy optimization in Vensim. I have read the relevant posts carefully, particularly http://www.ventanasystems.co.uk/forum/v ... tor#p13729 and http://www.ventanasystems.co.uk/forum/v ... php?t=6349 . But I think I still need some guidance, and would appreciate very much any help.
Basically I have followed the 2 approaches in the above mentioned posts. Please see the attached 2 models.
For approach 1, I used constants "% of car A in new purchase" and "% of car B in new purchase" to calculate the numbers of car A, B, and C bought every year. Note that C = total purchase per year minus A and B. In the optimizer, I define gap 2025 to 2030 as a payoff , and the total cost of buying cars per year as the other payoff. The weights are just arbitrarily assigned. The optimization parameters are just "% of Car A in new purchase" and "% of Car B in new purchase".
For approach 2, I used the VECTOR LOOKUP to convert car numbers of A, B, and C to be values in the vector. Therefore, the optimization parameters are "Car A number time value [Year]" and "Car B number time value [Year]". The payoff definition is the same as approach 1.
I am not entirely sure if I have done it correctly. Approach 2 seems to have followed the VECTOR LOOKUP approach discussed in the other 2 posts. But there were warnings about this approach as made in the posts. As for approach 1, I am not sure what I have done is a "closedloop" thing. Maybe not. How to do it? Moreover, this approach 1 seems to have an extra limitation, which is to fix the % of car type A, B, C in each year's new purchase, whereas the optimized result of approach 2 does not impose such limitation. Moreover, how to appropriately assign weights to the two payoffs if they are considered equally important? Alternatively, would it be possible to prioritize payoffs if I have a range of payoffs?
Fundamentally, I am wondering whether these two approaches make sense, and whether there are better ways to model this case?
Thank you so much!
I am working on a model which is about the average fuel economy (liter/kilometer) of cars in a stock of cars. The stock has a desired stock level (exogenous). There are 3 types of car representing different combination of price (exogenous) and fuel economy levels (exogenous). Every year, 3 types of cars are bought to supply the stock, and total number of cars bought every year is determined by the inflow of the stock. Annual distance driven by a car is a fixed constant. Average car lifetime is a fixed constant. The period of modelling is from 2018 to 2030.
There is an exogenously defined desired fuel economy level (constant, 7 liter per km per car). So the interest is to explore what would be "optimal" strategy of buying the 3 types of cars per year so that the gap between the "desired fuel economy" and the "average fuel economy of cars in stock" over the period of 2025 to 2030 can be minimized to the extent possible and at the same time the total cost of buying cars per year (throughout 2018 to 2030) can also be minimized to the extent possible.
This is my first time looking at policy optimization in Vensim. I have read the relevant posts carefully, particularly http://www.ventanasystems.co.uk/forum/v ... tor#p13729 and http://www.ventanasystems.co.uk/forum/v ... php?t=6349 . But I think I still need some guidance, and would appreciate very much any help.
Basically I have followed the 2 approaches in the above mentioned posts. Please see the attached 2 models.
For approach 1, I used constants "% of car A in new purchase" and "% of car B in new purchase" to calculate the numbers of car A, B, and C bought every year. Note that C = total purchase per year minus A and B. In the optimizer, I define gap 2025 to 2030 as a payoff , and the total cost of buying cars per year as the other payoff. The weights are just arbitrarily assigned. The optimization parameters are just "% of Car A in new purchase" and "% of Car B in new purchase".
For approach 2, I used the VECTOR LOOKUP to convert car numbers of A, B, and C to be values in the vector. Therefore, the optimization parameters are "Car A number time value [Year]" and "Car B number time value [Year]". The payoff definition is the same as approach 1.
I am not entirely sure if I have done it correctly. Approach 2 seems to have followed the VECTOR LOOKUP approach discussed in the other 2 posts. But there were warnings about this approach as made in the posts. As for approach 1, I am not sure what I have done is a "closedloop" thing. Maybe not. How to do it? Moreover, this approach 1 seems to have an extra limitation, which is to fix the % of car type A, B, C in each year's new purchase, whereas the optimized result of approach 2 does not impose such limitation. Moreover, how to appropriately assign weights to the two payoffs if they are considered equally important? Alternatively, would it be possible to prioritize payoffs if I have a range of payoffs?
Fundamentally, I am wondering whether these two approaches make sense, and whether there are better ways to model this case?
Thank you so much!
 Attachments

 Fuel economy goal seeking_test_approach 1.voc
 (604 Bytes) Downloaded 103 times

 Fuel economy goal seeking_test_approach 1.mdl
 (10.08 KiB) Downloaded 108 times

 Fuel economy_approach 1.vpd
 (97 Bytes) Downloaded 95 times

 Senior Member
 Posts: 102
 Joined: Wed Oct 25, 2017 3:52 pm
 Vensim version: PRO
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Attachments are files for approach 2.
 Attachments

 Fuel economy_approach 2.vpd
 (96 Bytes) Downloaded 99 times

 Fuel economy goal seeking_test_approach 2.voc
 (618 Bytes) Downloaded 95 times

 Fuel economy goal seeking_test_approach 2.mdl
 (10.9 KiB) Downloaded 90 times
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Here are some other open loop approaches:
http://metasd.com/2018/02/polynomialsi ... ionrules/
Since you're already using VECTOR LOOKUP, this is probably not needed.
More thoughts later.
http://metasd.com/2018/02/polynomialsi ... ionrules/
Since you're already using VECTOR LOOKUP, this is probably not needed.
More thoughts later.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/

 Senior Member
 Posts: 102
 Joined: Wed Oct 25, 2017 3:52 pm
 Vensim version: PRO
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Thanks a lot Tom. Looking forward very much to more thoughts from you. Many thanks.
tomfid wrote:Here are some other open loop approaches:
http://metasd.com/2018/02/polynomialsi ... ionrules/
Since you're already using VECTOR LOOKUP, this is probably not needed.
More thoughts later.

 Senior Member
 Posts: 102
 Joined: Wed Oct 25, 2017 3:52 pm
 Vensim version: PRO
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Hi Tom, please may I follow up with you on your thoughts about my questions in my original post above? Your help is greatly appreciated.
tomfid wrote:Here are some other open loop approaches:
http://metasd.com/2018/02/polynomialsi ... ionrules/
Since you're already using VECTOR LOOKUP, this is probably not needed.
More thoughts later.
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Here's a closedloop alternative.
I've made the choice of car a function of price and fuel economy. The weight to fuel economy varies with the gap between the standard and actual stock performance. This introduces a few new parameters (orange). It's not strictly cost minimizing, but the behavior is fairly similar to the VECTOR optimal version. Also, the fleet choice is instantly responsive to the standard, up to the point where it's impossible to lower fleet fuel consumption fast enough.
This is probably halfbaked, because I was in a hurry, but I hope it's helpful.
I've made the choice of car a function of price and fuel economy. The weight to fuel economy varies with the gap between the standard and actual stock performance. This introduces a few new parameters (orange). It's not strictly cost minimizing, but the behavior is fairly similar to the VECTOR optimal version. Also, the fleet choice is instantly responsive to the standard, up to the point where it's impossible to lower fleet fuel consumption fast enough.
This is probably halfbaked, because I was in a hurry, but I hope it's helpful.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/

 Senior Member
 Posts: 102
 Joined: Wed Oct 25, 2017 3:52 pm
 Vensim version: PRO
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Hi Tom,
Many thanks for your model, which is enlightening. Having studied it carefully, I still have a couple of questions and would be very grateful if you could offer some further guidance.
(1) The priority of each car type as a function of price and fuel economy is very sensible. But how to assign appropriate sensitivities in the equation below? For example, the price sensitivity is 2, whereas the fuel econ sensitivity is the sum of base fuel econ sensitivity (1) and gap closing fuel econ sensitivity (50) * Effective fraction gap.
Car A priority = (Price of car A/Reference Price) ^ Price Sensitivity * (Fuel economy of car A/Desired fuel economy) ^ Fuel Econ Sensitivity
Qualitatively, it is clear that the price sensitivity and fuel econ sensitivity shall differ substantially to enable the prioritization of fuel economy over price. However, quantitatively, how to ensure the specific values assigned to the sensitivities, e.g. 2, 50, etc, make sense (in realworld)?
(2) The Effective Fractional Gap is calculated as Gap/Desired fuel economy*RAMP( 1/"Phasein Time" , INITIAL TIME , (INITIAL TIME+"Phasein Time") ). Why is the RAMP necessary here? It seems to be something similar to smoothing. If so, how about using SMOOTH(Gap/Desired fuel economy, "Phasein Time" )? Please see the attached model.
(3) The priority approach seems to be similar to Resource Allocation (section 13.2.13 of Business Dynamics), in which the attractiveness is expressed as a multiplication of individual effects (exponential). The general function is Attractiveness i = f1(ai1)*f2(ai2)*...*fm(aim), j = 1, ...., m. Specifically, fj(aij) = exp (kj*aij/aj), where kj is the sensitivity and aj is the reference value. I have tried to apply this approach in my case, and the following is the equation for priority for type A.
Car A priority = EXP((Price of car A/Reference Price)*Price Sensitivity ) * EXP((Fuel economy of car A/Desired fuel economy)*Fuel Econ Sensitivity )
The results turn out to be very similar to those from (1). But, apparently the expressions of priority (attractiveness) are different. Which one should be more appropriate? I searched the forum and found an old SD mailing list archive in 2001 (http://www.ventanasystems.co.uk/forum/v ... .php?t=208 ). It's very useful, but I think it would still be very helpful if some recent thoughts about this issue could be shared.
I have attached the model using the exponential function of the attractiveness, which is based on the one you shared earlier.
Thank you so much for your time and help!
Many thanks for your model, which is enlightening. Having studied it carefully, I still have a couple of questions and would be very grateful if you could offer some further guidance.
(1) The priority of each car type as a function of price and fuel economy is very sensible. But how to assign appropriate sensitivities in the equation below? For example, the price sensitivity is 2, whereas the fuel econ sensitivity is the sum of base fuel econ sensitivity (1) and gap closing fuel econ sensitivity (50) * Effective fraction gap.
Car A priority = (Price of car A/Reference Price) ^ Price Sensitivity * (Fuel economy of car A/Desired fuel economy) ^ Fuel Econ Sensitivity
Qualitatively, it is clear that the price sensitivity and fuel econ sensitivity shall differ substantially to enable the prioritization of fuel economy over price. However, quantitatively, how to ensure the specific values assigned to the sensitivities, e.g. 2, 50, etc, make sense (in realworld)?
(2) The Effective Fractional Gap is calculated as Gap/Desired fuel economy*RAMP( 1/"Phasein Time" , INITIAL TIME , (INITIAL TIME+"Phasein Time") ). Why is the RAMP necessary here? It seems to be something similar to smoothing. If so, how about using SMOOTH(Gap/Desired fuel economy, "Phasein Time" )? Please see the attached model.
(3) The priority approach seems to be similar to Resource Allocation (section 13.2.13 of Business Dynamics), in which the attractiveness is expressed as a multiplication of individual effects (exponential). The general function is Attractiveness i = f1(ai1)*f2(ai2)*...*fm(aim), j = 1, ...., m. Specifically, fj(aij) = exp (kj*aij/aj), where kj is the sensitivity and aj is the reference value. I have tried to apply this approach in my case, and the following is the equation for priority for type A.
Car A priority = EXP((Price of car A/Reference Price)*Price Sensitivity ) * EXP((Fuel economy of car A/Desired fuel economy)*Fuel Econ Sensitivity )
The results turn out to be very similar to those from (1). But, apparently the expressions of priority (attractiveness) are different. Which one should be more appropriate? I searched the forum and found an old SD mailing list archive in 2001 (http://www.ventanasystems.co.uk/forum/v ... .php?t=208 ). It's very useful, but I think it would still be very helpful if some recent thoughts about this issue could be shared.
I have attached the model using the exponential function of the attractiveness, which is based on the one you shared earlier.
Thank you so much for your time and help!
tomfid wrote:Here's a closedloop alternative.
Fuel economy goal seeking_test_approach 3.mdl
I've made the choice of car a function of price and fuel economy. The weight to fuel economy varies with the gap between the standard and actual stock performance. This introduces a few new parameters (orange). It's not strictly cost minimizing, but the behavior is fairly similar to the VECTOR optimal version. Also, the fleet choice is instantly responsive to the standard, up to the point where it's impossible to lower fleet fuel consumption fast enough.
This is probably halfbaked, because I was in a hurry, but I hope it's helpful.
 Attachments

 Fuel economy goal seeking_test_approach 4.mdl
 (14.28 KiB) Downloaded 89 times

 Senior Member
 Posts: 102
 Joined: Wed Oct 25, 2017 3:52 pm
 Vensim version: PRO
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Hi Tom, just a further question following my post above.
(4) As you pointed out, whilst the results of the closedloop approach are very similar to using VECTOR LOOP, it is not cost minimizing, strictly speaking. So, is there a way to extend the current closedloop approach to realise cost minimizing? Or, is VECTOR LOOP the only approach to do it?
Many thanks.
(4) As you pointed out, whilst the results of the closedloop approach are very similar to using VECTOR LOOP, it is not cost minimizing, strictly speaking. So, is there a way to extend the current closedloop approach to realise cost minimizing? Or, is VECTOR LOOP the only approach to do it?
Many thanks.

 Senior Member
 Posts: 102
 Joined: Wed Oct 25, 2017 3:52 pm
 Vensim version: PRO
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Sorry, I meant "VECTOR LOOKUP". It was a typo.
WayneZhou2009 wrote:Hi Tom, just a further question following my post above.
(4) As you pointed out, whilst the results of the closedloop approach are very similar to using VECTOR LOOP, it is not cost minimizing, strictly speaking. So, is there a way to extend the current closedloop approach to realise cost minimizing? Or, is VECTOR LOOP the only approach to do it?
Many thanks.
Re: Optimization  VECTOR LOOKUP and other approaches ?)
I think the appropriate choice depends on the context.
 If there's a single fleet manager making decisions with a lot of information, the VECTOR LOOKUP approach is reasonable, especially if you modify it to make it responsive to uncertainty or variation in the target.
 If the decision is distributed over a population of boundedly rational actors, it's not reasonable, because it implies that people know the future etc.
 If there's a single fleet manager making decisions with a lot of information, the VECTOR LOOKUP approach is reasonable, especially if you modify it to make it responsive to uncertainty or variation in the target.
 If the decision is distributed over a population of boundedly rational actors, it's not reasonable, because it implies that people know the future etc.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Optimization  VECTOR LOOKUP and other approaches ?)
There are several ways to make a hybrid that is targetresponsive, but more accurately cost minimizing. Generally, you need more flexibility in the functional form:
 more inputs
 nonlinear transformations of the inputs
 advance information about the inputs (for example, policies are typically announced before they are enforced)
 integrals or derivatives of the inputs
It might be helpful to think about what a closed form solution to a simplified version of the optimization problem might look like.
 more inputs
 nonlinear transformations of the inputs
 advance information about the inputs (for example, policies are typically announced before they are enforced)
 integrals or derivatives of the inputs
It might be helpful to think about what a closed form solution to a simplified version of the optimization problem might look like.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Hi
I join this discussion a bit late.
I start again with the purpose of the model. It is to determine the right amount of cars of each category to buy each year, that depends on each category characteristics and the objective: minimizing the buying costs and the gap between the observed and real petrol year consumption.
About this objective, one can notice that in the case of the buying costs, it is expressed in dollars/year, and the gap may be expressed in gallons/year. But the last objective is not very clear.
How much small must be the gap? It should be interesting to have a rough idea of the penalty associated with each level of gap, and have an interval for this penalty.
It would then be better to use the same weights in the .vpd file equal to 1, and to multiply the gap by a parameter that can be varied inside an interval to express different hypotheses of penalty. this way the second weight can be easily changed.
It will then be easy to test different optimizations with different values of penalty.
A second idea would be to start with a simpler model and use only one type of car, and once this model is thoroughly understood, go to 2 categories etc..
Regards.
JJ
I join this discussion a bit late.
I start again with the purpose of the model. It is to determine the right amount of cars of each category to buy each year, that depends on each category characteristics and the objective: minimizing the buying costs and the gap between the observed and real petrol year consumption.
About this objective, one can notice that in the case of the buying costs, it is expressed in dollars/year, and the gap may be expressed in gallons/year. But the last objective is not very clear.
How much small must be the gap? It should be interesting to have a rough idea of the penalty associated with each level of gap, and have an interval for this penalty.
It would then be better to use the same weights in the .vpd file equal to 1, and to multiply the gap by a parameter that can be varied inside an interval to express different hypotheses of penalty. this way the second weight can be easily changed.
It will then be easy to test different optimizations with different values of penalty.
A second idea would be to start with a simpler model and use only one type of car, and once this model is thoroughly understood, go to 2 categories etc..
Regards.
JJ
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Hi
Sounds strange.
It is no more possible to edit previous posts!
I then add this remark.
One interest of starting with one category of vehicle, is that when you go to 2 categories etc.., you may use a subscript for the category. this will simplify the sketch of the model.
Regards.
JJ
Sounds strange.
It is no more possible to edit previous posts!
I then add this remark.
One interest of starting with one category of vehicle, is that when you go to 2 categories etc.., you may use a subscript for the category. this will simplify the sketch of the model.
Regards.
JJ
Re: Optimization  VECTOR LOOKUP and other approaches ?)
Good comments, JJ.
I still have a post edit button  possibly it's a momentary glitch or browser issue?
I still have a post edit button  possibly it's a momentary glitch or browser issue?
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/