Page 1 of 1

Defining Units

Posted: Fri Apr 26, 2019 12:14 pm
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!

Re: Defining Units

Posted: Fri Apr 26, 2019 1:19 pm
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).

Re: Defining Units

Posted: Sun Apr 28, 2019 7:43 am
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!!!:)

Re: Defining Units

Posted: Sun Apr 28, 2019 7:55 am
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)?

Re: Defining Units

Posted: Mon Apr 29, 2019 8:27 am
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.