Simple Optimization

Use this forum to post Vensim related questions.
Post Reply
duilio
Senior Member
Posts: 59
Joined: Wed Oct 20, 2004 3:07 pm

Simple Optimization

Post by duilio »

Hi all,
I'm doing some exercise on optimization, particularly I'm working on the very simple example contained in Coyle's book. Basically the objective function for the optimization should be the difference between desired inventory and inventory and the parameters are 4 constants (time_to_correct_inventory, ....) . How can I write a payoff function in VENSIM to do that? I put Desired inventory with weight one and Desired inventory with a weight of -1 in the payoff definition menu . The optimization worked fine, but is it correct? How can be sure that the weigth are the right one? Is it correct to define a payoff in that way?
And what if my payoff is a more complex expressions?


Thanks a lot in advance!!
Giovanni
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

It is probably DMC problem. At what stage of the DMC problem are you. What pages and chapter of Coyle's book are concerned?
JJ
duilio
Senior Member
Posts: 59
Joined: Wed Oct 20, 2004 3:07 pm

Post by duilio »

Hi JJ,
I'm on the simpler example on page 242 (The performance of a simple model) , the one prior to DMC example.
Attached the model in VENSIM

Thanks!!!
G
Attachments
Problem 2 Coyle Model.mdl
(4.35 KiB) Downloaded 230 times
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Coyle optimization problem

Post by LAUJJL »

Hi Giovanni

Joined the model with some changes.

First I have initialized the two stocks with constants.
It seems more logical than with auxiliaries.
Secondly I have made the inventory impossible to become negative. To allow the possibility to include the time to eliminate backlog to be optimized I have added a limit to the production, otherwise you can have the production grow unrealistically.
About what to optimize it depends on the problem.
As Coyle notices, one must be careful about what to optimize and not to transform a real problem into an unrealistic mathematical model. One can optimize the variation of the backlog and/or the inventory, or the maximum of the inventory or the backlog etc..
In the model I optimize the inventory discrepancy by squaring it.
Joined the zipped model with the vpd and voc optimization files.
That little model is in fact much more tricky than one would think and any results must be scrutinized with attention.
Reality checks would be probably useful too.
Regards.
JJ
Attachments
Coyle_prob_optimization.zip
(2.36 KiB) Downloaded 228 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

In general, it's a little odd to optimize (desired inventory-actual inventory), because it's possible that discrepancies could arise as a consequence of poor formulation of desired inventory. A more typical setup would be to describe explicit costs of having too much or too little inventory, then optimize to minimize total cost.

However, assuming that Coyle has a good reason for the simple setup, you want something like the following:

Create a variable that summarizes the inventory error. This might be:
inventory error = ABS(desired inventory-actual inventory) or
inventory error = (desired inventory-actual inventory)^2

Then use a Policy payoff type, with your inventory error weighted by -1 (or any negative value), to signify that errors are bad. Vensim will then minimize the time-integrated error.

Tom
karankhosla
Senior Member
Posts: 107
Joined: Wed Nov 26, 2008 6:12 am

Simple Optimization

Post by karankhosla »

Dear Giovanni,

Attached is my model... on the same lines of both what JJ and Tom were saying.

I created a penalty function that measures the square of the difference between desired and actual inventory. We then cumulate this difference and normalize it in the form of an objective function to give you an easy indicator of the error [see model].

I then use policy optimization with a weight set to -1 as Tom said to get the optimizer to minimize the scaled objective function.

To see if this makes sense, I put a penalty carrying cost to the backlog of 1 USD/part/Week and to the Inventory of 0.5 USD/part/Week.
Total Costs/week = Backlog Cost per Week * Backlog + Inventory Cost per Week * Inventory

If the optimizer is doing what it should, cumulative carrying costs should be lower with the optimized parameter values - which they are!

Hope this helps.

Best Wishes,

Karan

[Edited on 9-23-2010 by karankhosla]
Attachments
Coyle 2 Optimize_KK.zip
(34.98 KiB) Downloaded 227 times
duilio
Senior Member
Posts: 59
Joined: Wed Oct 20, 2004 3:07 pm

Post by duilio »

Many thanks to everybody, I'll had a look at all the examples
!!
Hope to return the help back at some point in time!!

Ciao!

G
Post Reply