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!
Defining Units
Re: Defining Units
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).
"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).
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Defining Units
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
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)?
Is there any way I could get rid of this error besides defining a new variable for the number(200)?
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Defining Units
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.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559