add up values in last year

Use this forum to post Vensim related questions.
Post Reply
tino
Junior Member
Posts: 6
Joined: Mon Jan 31, 2005 8:45 am

add up values in last year

Post by tino »

Again stuck at one problen:
one variable has different values each time step (year). is it possible to add up these values in the end of the last time step (year)?

Example:
Value year 1: 13
Value year 2: 20
Value year 3: 10
Value year 4: Summ=43

Thank you for your help!!

[Edited on 2-1-2005 by tino]
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

reply add values at the last time

Post by LAUJJL »

Hi

If you want to add values only at the last time step, you have to put them somewhere in the meanwhile.
This can be done, by putting them in a level, that will keep its value, but you will need Venim pro for that, if you have many values to keep to put them in a subscripted array. Or you can define many levels with different names in PLE, but it is cumbersome.
The other way, that works with any Vensim version, is to add the values at each time step in a level. Or course the work will be done at each time step and not at the end, but it does not make any difference, unless you want to do something particular in the meanwhile.
Regards.
J.J. Laublé
tino
Junior Member
Posts: 6
Joined: Mon Jan 31, 2005 8:45 am

example?

Post by tino »

Thank you J.J. for your reply!!Unfortunately this is my very first SD-model and so it looks as if I need some special explanation. If i am honest, I did not get it! So if you have the time and mood to show me an example, I would be very thankfull.
I will try to attach my model so you can see what i mean:
The variable named "Question" (in green and the only english one) has different values each year (2005 its something like 21000, 2006 its 25000 and so on. The last simulated year is 2019. I would like to form a level that is the summ of all the "year-values" - that means something like 270 000.
Best regards and thank you,
Tino
Attachments
Modell2.mdl
(25.61 KiB) Downloaded 838 times
Administrator
Super Administrator
Posts: 4848
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

I think it might be much more productive if you went through the tutorial, it includes details on how to construct levels and on how to use the common functions within Vensim.

The following webpage has links to all the Vensim documentation (including the modelling guide).
http://www.vensim.com/documentation.html

The following document is a PLE short tutorial. This also explains the basics of causal loop diagramming.
http://www.public.asu.edu/~kirkwood/sysdyn/VenPLE.pdf

Finally, check out the Vensim molecules from
http://www.vensim.com/freedownload.html. These are a set of building blocks for models, and will almost certainly have what you need in this case.

Hope this helps.

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

reply cumulative problem

Post by LAUJJL »

< example?

< Thank you J.J. for your reply!!Unfortunately this is my very first SD-model and so it looks as if I need some special < < explanation. If i am honest, I did not get it! So if you have the time and mood to show me an example, I would be < < very thankfull.
< I will try to attach my model so you can see what i mean:
< The variable named "Question" (in green and the only english one) has different values each year (2005 its < < < < < something like 21000, 2006 its 25000 and so on. The last simulated year is 2019. I would like to form a level that is < the summ of all the "year-values" - that means something like 270 000.

Hi

I do not see any particular difficulty in your problem.
The question values are negative but it does not affect the problem.
I have joined a model3.mdl file.

It looks like that you are using a PLE Version without subscripts, other while you would use them and
have a much more simple sketch.

It is better too to check the units, and to have no errors at least only warnings with unit checking.
Although that looks cumbersome, unit checking is mandatory with bigger models, and allows you to
check dimension consistency and will permit to find logic errors in your models.

It is better too while using PLE, to use several views, it will allow you to better the presentation.

One other point. Like many beginners, you look like rushing too much, thinking that it will shorten the delay to
finish your model. It will do exactly the contrary, making it possible that you will never finish it at all!

It would be better to do little programs and to test them and run them fully, even if the results have nothing to do
with reality at first.

I have painfully learned that there are three things essentials to get through:
First develop by very little steps.
By little step I mean: if you would want to demonstrate the equation E = MC2 you would start with 1 + 1 = 2 and the
second step would be 1 + 2 = 3.
A step can never be too small, but can be very easily too big.

Second principle, never add something knew that you do not master to a model, without having tested it in a very simple separate model.

Once a step is accomplished, use the model fully to see the difference between the old one.

With these simple principles, but hard to follow because it needs patience, you can build very useful models whatever their complexity very quickly!
And when I started with SD, about three years ago, I had thirty years of programming experience with different languages, in scientific and mainly business applications


A second point. You are constructing a model with a lot of soft variables having to do with social problems.
These kind of models are to my opinion very hard to model, because you do not have the data to check you model
with. How do you measure your decrease of spirituality? I personally think that if you can first start with something very concrete with real data and preferable simple, your learning process will be much easier and you can then try to model models with soft variables.
Of course if you have been modelling social systems with other tools, and have a lot of experience with them, it may be easier. But I should be careful anyway.

Regards.
J.J. Laublé
Attachments
model3.mdl
(26.22 KiB) Downloaded 839 times
tino
Junior Member
Posts: 6
Joined: Mon Jan 31, 2005 8:45 am

THANK YOU once again

Post by tino »

Thank you again for your support! it is indeed very hard to start SD as an autodidact, especially if there is nobody around knowing how to do it professionally. Nevertheless i see big potetial for SD in my profession so i try to learn.
i already found out that passions is essential.
i usualy try to model my systems in dimension consistency, but in this special case it was to much - i focus on the core work.
Thank you again for all your advise - its great work you do! And sorry for my bad english.....
Best regards,
Tino
tino
Junior Member
Posts: 6
Joined: Mon Jan 31, 2005 8:45 am

last question

Post by tino »

all right, this is the last time i bother you with my cumulation thing:
i checked out the model you sent me, but the cumulation does not include the last value (value in year 2019). the addition starts at time step 2 with value of time step 1.
and is it possible to proceed with a level that is just the cumulated value (269 000)?
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

reply accumulation

Post by LAUJJL »

Hi,

The values associated with a level, are the values at the beginning of the period of time, so you do not get the value at the end of the last period of time.
See the model model4 joined to add a last variable to get it.
I do not understand your last question.
If you add more time steps, you will automatically use your last value.
Otherwise it is impossible to use a value before you have calculated it!
Regards.
J.J. Laublé
Attachments
model4.mdl
(26.78 KiB) Downloaded 738 times
Post Reply