I don't understand.........................

Use this forum to post Vensim related questions.
Post Reply
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

I don't understand.........................

Post by nikvyas »

Afternoon everyone.

I was wondering if some kind soul (Bob, JJ) can help me with the attached model?

I can't understand why in the process "Total", the values of [s1,p1], [s1,p2], [s1,p3], [s1,p4] ...................[s1,p20] aren't exactly the same at a particular point in time.

For instance, at t=7089, the value of [s1,p2], [s1,p5], [s1,p11] and [s1,p17] is 11.25 whilst the rest is at 10. This discrepancy occurs frequently - as I say, I would have expected [s1,p1]...............[s1,p20] to have been exactly the same at t=7089.

Hope somebody can help - it's a fairly complex model I'm afraid, but I'd be very, very grateful for any help.

Thanks

Nik

[Edited on 2-20-2008 by nikvyas]
Attachments
scratchpad.mdl
(60.04 KiB) Downloaded 287 times
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Can you simplify the equation for "Total"? I've never seen an equation like it.

Almost certainly a typo somewhere.

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

help from a kind soul

Post by LAUJJL »

Hi Nik

I have an answer. It is probably that the equation for total is bugged. And it is difficult not to make a bug in such a complex equation.
I think that you confuse, efficiency and complexity.
SD is not adapted for detailed complexity.
You must stop a while, and try to simplify your model.
SD is the art of finding the 20% of inputs that govern 80% of the output. As long as you try to incorporate 100% of the input, you will always have models that are intractable.
By the way, models without units especially of that complexity have a great probability to be highly bugged.
If you want absolutely to conserv this level of complexity,
one way to simplify things, is to use different equations for each subscript, using the add equation button at the right.
This helps equation debugging as they are much shorter.
You will then be able to explore why the total value is different with different subscripts values.
Regards.
JJ

[Edited on 20-2-2008 by LAUJJL]

[Edited on 20-2-2008 by LAUJJL]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi Nik,

I can reproduce what you are seeing and I agree it should not be that way (I can't actually read the equation but I can remove the Probability subscript from the left and the model is still OK so it should generate the same value for every subscript element). I will dig into this a bit to see why it would be returning different numbers.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks very much for your replies Tony, Kind Soul JJ and Bob. I agree that the model is a little too complex, but believe me when I say that I've tried very hard to reduce the complexity! I'll try to do what you suggest JJ - makes perfect sense.

Thanks very much for looking into this Bob. The attached model is part of a much larger model that is going to form part of a £2 billion support contract! What I have attached is actually the most important part, so I'd be eternally grateful if we good get to the bottom of it.

Thanks again.

Nik
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I looked at this. The reason some values are different is that there remains one use of RANDOM UNIFORM that has not been replaced by the variable random number. It looks like all the others are clean. Because this is buried so deep in the nested IF THEN ELSE statements it only rarely matters.

As far as a more elegant way to do this. I think using the VECTOR LOOKUP with the use argument set to 5 for lookup invert you can get the same logic. Something like

sub : (s1-s10)
subequiv <-> sub
lower[sub,subequiv] = INITIAL(IF THEN ELSE(sub >= subequiv,1,0))
cum threshold[sub] = SUM(threshold[subequiv!]*lower[sub,subequiv!])
failtype = VECTOR LOOKUP(cum threshold[s1],random number,0,1,5)

you will need to play around to make that work but something along those lines should and will keep you out of the crazy nesting.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks Bob. You couldn't elaborate a bit on "there remains one use of RANDOM UNIFORM that has not been replaced by the variable random number. It looks like all the others are clean." could you?

Thanks

Nik
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

static model

Post by LAUJJL »

Hi Nik

There is something that I do not understand in your model.

Although the sketch of the first view seems to have some levels with rates,
in fact they are auxiliaries.
When one looks at the other views, one does not see any level either.
There are no feed back loops and even no dynamic at all in your model.
It is purely static and it is just simulating different completely unrelated possibilities.

It is in fact possible to simulate your model on one period only, generating the 8736 possibilities. The model uses the time as a convenient way to represent all these possibilities but not as a system where there is any dynamic.
Are the different periods really independent from one another in the reality?
Regards.
JJ
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Hi JJ - yes, at the moment I haven't put any feedback loops and on any particular seed the results will be exactly the same on every run.

However, one of the purposes of the model is to give a predicted measure if all variables were at their nominal values. We can then run a series of sensitivity analysis, by varying each variable by a specific percentage and seeing the effect on the measure - this will then determine those variables that are most critical in achieving the desired measure.

I have only attached a very small part of the model - if I had attached the whole model, you would be able to see the purpose more clearly. However, the model is by no means complete and as well as adding feedback loops, I need to add resource constraints (people etc).

It would make it clearer if i were able to tell you what the model represents - unfortunately, because of confidentiality etc i am not in a position to do so. However, I am sure you will easily be able to work out the purpose.

Thanks

Nik
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi Nick,

There is a function use RANDOM UNIFORM embedded in the equation for total. If you remove this and replace it with the variable "random number" behavior will be as expected.

You might want to View>As Text and just check to see if all the RANDOM function uses are intentional - there are others that look to me to be errors as well. If you are trying to see if a random number is in a particular range you need to put the random number in a variable and then test to see if the variable is in the range - otherwise the comparison is always to a new draw so that

result = IF THEN ELSE(RANDOM UNIFORM(0,1,0) < .33,2,
IF THEN ELSE(RANDOM UNIFORM(0,1,0) < .67,4,
6)

will return 2 33% of the time, 44% of the time and 6 23% of the time not each value 33% of the time.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks very, very much Bob.
Post Reply