Defining Units

Use this forum to post Vensim related questions.
Post Reply
grayven87
Junior Member
Posts: 15
Joined: Wed Apr 17, 2019 3:54 pm
Vensim version: PLE

Defining Units

Post by grayven87 »

Hi everyone

I have a homework model and we are told to define the units.My question is, Should we add units for binary and Dimensionless variables, like numbers and percents?

Would be great if you guys could help me out!
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Defining Units

Post by tomfid »

Definitely - percent is important because it's easy to inadvertently mix % and fractions. Define a variable called "100 percent" with units of "percent" and use that to convert between the two. Something like:

"100 percent" == 100 ~ percent
birth rate = 2.3 ~ percent/year
fractional birth rate = birth rate/"100 percent" ~ fraction/year
births = population*fractional birth rate ~ people/year

Note that "fraction" is a synonym for "Dnml" (dimensionless).

You should also mark binary switches and other integer count numbers with Dmnl, if appropriate. Model>Units Check should always pass (maybe with a few warnings for lookups with dimensioned inputs if really needed, though I avoid that).
grayven87
Junior Member
Posts: 15
Joined: Wed Apr 17, 2019 3:54 pm
Vensim version: PLE

Re: Defining Units

Post by grayven87 »

tomfid wrote: Fri Apr 26, 2019 1:19 pm Definitely - percent is important because it's easy to inadvertently mix % and fractions. Define a variable called "100 percent" with units of "percent" and use that to convert between the two. Something like:

"100 percent" == 100 ~ percent
birth rate = 2.3 ~ percent/year
fractional birth rate = birth rate/"100 percent" ~ fraction/year
births = population*fractional birth rate ~ people/year

Note that "fraction" is a synonym for "Dnml" (dimensionless).

You should also mark binary switches and other integer count numbers with Dmnl, if appropriate. Model>Units Check should always pass (maybe with a few warnings for lookups with dimensioned inputs if really needed, though I avoid that).

Thanks a lot!!!:)
grayven87
Junior Member
Posts: 15
Joined: Wed Apr 17, 2019 3:54 pm
Vensim version: PLE

Re: Defining Units

Post by grayven87 »

I've been defining the units but for defining the cost of hiring, I had to use 200*"staff no." and the software's unit checking part gives me an error that the unit of money for cost of hiring isn't correct...
Is there any way I could get rid of this error besides defining a new variable for the number(200)?
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Defining Units

Post by Administrator »

Vensim is right, this is a unit error.

It's very bad practice to have numbers hard coded into a model. Create a new variable (I'm assuming in this case it's "cost to hire one staff") and give it the value 200. Then use this and if in future the cost goes up, you can then change the one constant instead of having to change units.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Post Reply