Units conversion functions

Use this forum to post Vensim related questions.
Post Reply
hakani
Member
Posts: 22
Joined: Mon Nov 13, 2023 11:52 am
Vensim version: PLE

Units conversion functions

Post by hakani »

I'm really trying hard to make the model work fully and properly. But I couldn't get rid of unit errors. Because the system has to work on a monthly basis and the values are given annually. When converting month and year, I try to get results by dividing by 30 or multiplying by 12. When I tested the system, I was able to run it without any problems. The values are also correct. But unit errors never stop.
1- What can I do to get rid of unit errors? ?

2-Are there any functions used in month day year conversions?

3-Which functions can I use to calculate the input entities?

4-How can I avoid unit errors in formulas that use different units?

Kind regards
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Units conversion functions

Post by Administrator »

Don't divide by 30 or multiply by 12. Vensim sees these as dimensionless numbers, so they will not change the units.

If I see something like
VALUE = some calculation / 30

My immediate question is "what does the 30 mean"? It's much better to create a constant, give it a name (average days per month). Then I know exactly what the 30 is.


Conversion is easy though, and it means your model is easier to understand for others.

If you want to convert between months and years, create a constant called "months per year".

MONTHS PER YEAR = 12
Units : month/year

Now if you have a value that is measured in years, for example

YEARLY SALARY = 10000
Units : $/year

To convert to months, you use
MONTHLY SALARY = YEARLY SALARY / MONTHS PER YEAR
Units : $/month
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