't' is not a variable name

Use this forum to post Vensim related questions.
Post Reply
tjclifford
Junior Member
Posts: 9
Joined: Wed Mar 10, 2021 1:19 am
Vensim version: PLE

't' is not a variable name

Post by tjclifford »

Good day, I'm working on the car population model in Donnella Meadow's book Thinking in Systems, and the formula for the population
Level object is given as:

Stock: population(t) = population(t - dt) + (births - deaths) × dt Initial stock value: population = 6.6 billion people
I tried to whittle it down to: population(t - dt) + (births - deaths) x dt

It has been awhile since I've used vensim(, since Vensim PLE - I'm running Vensim PLE Plus 8.2.2 x64)

I thought the problem was that her model was written in Stella, but I got the same error.
e: Unit errors Yes - this looks right. You'll see this notation in the literature a lot:

The note at the top of the forum: "dStock/dt = rateConstant * Stock
or in discrete time: Stock(t) = Stock(t-dt) + dt*(rateConstant*Stock)
which is equivalent to Vensim: Flow = rateConstant*Stock Stock = INTEG( flow, initval ..."
I tried to work that out and get rid of the error " 'but I'm having a rough time.

Can anyone do a translation for me, the new syntax is confusing.

Thank you.
tjclifford
Junior Member
Posts: 9
Joined: Wed Mar 10, 2021 1:19 am
Vensim version: PLE

Re: 't' is not a variable name

Post by tjclifford »

I said this is the 'carpopulation' Level object, but that's a later model.
This one is a simpler population model.

Mr. fumble-fingers....
tomfid
Administrator
Posts: 3815
Joined: Wed May 24, 2006 4:54 am

Re: 't' is not a variable name

Post by tomfid »

In Vensim t is "time" and dt is "TIME STEP" but you'll hardly ever use these explicitly in an equation.

In your model, population should be a level (stock). In the first equation field, just put "births-deaths". In the second field (initial value), put 6.6 billion or whatever. If you look at the model in a text editor, you'll find that this creates Population = INTEG( Births-Deaths, 6.6e9 ). Don't forget to populate the units!

The Stella notation is rather unfortunate, because it encourages thinking in discrete steps, and implies that we're doing Euler integration, which may not be the case.
tjclifford
Junior Member
Posts: 9
Joined: Wed Mar 10, 2021 1:19 am
Vensim version: PLE

Re: 't' is not a variable name

Post by tjclifford »

Thank you, Tom.
Post Reply