Maximum value

Use this forum to post Vensim related questions.
Post Reply
Danny
Junior Member
Posts: 10
Joined: Fri Apr 25, 2008 11:42 am

Maximum value

Post by Danny »

Hello everyone,

I have a problem with one of the parameters in a Vensim model (I use Vensim DSS).
I want to express the following:
First the variable x is used in different equations (it should take every integer from 0 to 100),
then the term “earnings minus losses” (both variables are dependent from x) is calculated.
Now the model should tell me (for each time step) the variable x, for which the term “earnings minus losses” is maximum.
This max value is then used further in the model.

How can I do this with Vensim or is it possible at all?

I tried the GET DATA MAX function, but the problem seems to be the time step for the calculation… Vensim gave me the message that variable x is used simultaneously in different equations.

I am a beginner in the system dynamics modeling world, so I’d appreciate help of any kind,

Thanks in advance,
Danny
Administrator
Super Administrator
Posts: 4832
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

You need to either use the optimizer or the FIND ZERO function (to break the simultaneous loop). Depends on which is most suitable.

More info on FIND ZERO.
http://www.vensim.com/documentation/html/22430.htm

Optimization
http://www.vensim.com/documentation/vensim.htm
User's guide, chapter 18.

From your description, it sounds as if the optimizer is the more suitable for what you want to do.

Hope this helps.

Tony.
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Post by LAUJJL »

If you have not found the solution by yourself, try to simplify your problem to the utmost and explain and/or post model that illustrates it.
Regard.
JJ
Danny
Junior Member
Posts: 10
Joined: Fri Apr 25, 2008 11:42 am

Post by Danny »

Thanks a lot.
I will check that out immediately...

Thanks for the quick reply!
Danny
Danny
Junior Member
Posts: 10
Joined: Fri Apr 25, 2008 11:42 am

Post by Danny »

Hello,

Sorry for my late response, but there were other urgent issues waiting on my desk.

I think the optimization or the FIND ZERO do not work for me.

I try to explain the problem differently:
The parameter FW(%) (0 to 100 %) is the problem.
It is used to calculate a set of parameters which then result in the calculation of DIFF.
OptFW(%) is the one FW (e.g. 65 %) for which DIFF is highest.
OptFW is then used in further equations…
I guess my problem is concerning the time steps:
One part of the model is using OptFW (one value) but the other part of the model needs to be calculated 100 times to get 1 value for further calculation (leading to other parameters). So I have a submodel which provides data for the real model.

How can I do this with Vensim?? Can I do it at all?

Thanks for any help,
Danny
Administrator
Super Administrator
Posts: 4832
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Can you post the model so we can take a look?
Danny
Junior Member
Posts: 10
Joined: Fri Apr 25, 2008 11:42 am

Post by Danny »

ok, no problem.

Thanks in advance
Attachments
Maxvalue_draft.mdl
(8.81 KiB) Downloaded 554 times
Administrator
Super Administrator
Posts: 4832
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Can you use the optimizer? Run it maximizing the value of "diff"?

There is another simultaneous equation in there as well. I cannot fix it (don't know what the model parameters mean).
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Another approach could be used here. You could create 101 subscripts

FWSub : (FW0-FW100)
FWTry[FWSub] = INITIAL(FWSub-1)

then subscript Diff and the stuff leading up to it by FSSub - then use the VECTOR SORT function to figure out which subscript (and therefore value) is the best and assign this to OptFW.

I have demonstrated this in the attached model since I am sure the above is not very clear.
Attachments
FWTry.mdl
(1.96 KiB) Downloaded 562 times
Danny
Junior Member
Posts: 10
Joined: Fri Apr 25, 2008 11:42 am

Post by Danny »

This works!
Exept for that other problem, of course. But I can fix that.

Thank you very much,
Danny
Post Reply