Hello fellow Vensimers,
I am stuck with the problem of WHAT UNIT to use when using the TREND function.
Whatever I try I will always fail the Units Check with my model.
I went through STERMANs chapter 16 of course, and also consulted the Vensim Help section. In the Vensim Help (under Dynamic Functions --> TREND) section an example file (TREND.mdl) is provided, but unfortunately it also fails the Units Check on Vensim.
I then took a step back and created a very simple mock population growth model including a TREND function (TREND( {input} , {avgtime} , {initrend} ) and tried to fix it. The only thing I found out is that when I use either dmnl or 1 as a unit Vensim only returns one error. In all other cases it returns two.
1/Time as usually recommended does also not work in either case.
Cheers,
Max
Here when using 1/Year:
***********************************************
Error in units for the following equation:
#Materials Trend>TREND>avval# =
INTEG( ( Material Usage per Unit
- #Materials Trend>TREND>avval# )
/ ( 1) ,
Material Usage per Unit
/ ( 1
+ ( 0)
* ( 1) ) )
#Materials Trend>TREND>avval# --> Material/Widget
Material Usage per Unit --> Material/Widget
Analysis of units error:
Units missmatch in INTEG
( Material Usage per Unit
- #Materials Trend>TREND>avval# )
/ ( 1)
Has Units: Material*Year/Widget
Material Usage per Unit
/ ( 1
+ ( 0)
* ( 1) )
Has Units: Material/Widget
***********************************************
Error in units for the following equation:
Materials Trend =
TREND ( Material Usage per Unit ,
1,
0)
Materials Trend --> 1/Year
Material Usage per Unit --> Material/Widget
Analysis of units error:
Right hand and left hand units do not match
Materials Trend
Has Units: Dimensionless/Year
TREND ( Material Usage per Unit ,
1,
0)
Has Units: Dimensionless
TREND function --> Units Check
-
- Super Administrator
- Posts: 4589
- Joined: Wed Mar 05, 2003 3:10 am
Re: TREND function --> Units Check
Materials Trend =
TREND ( Material Usage per Unit ,
1,
0)
Materials Trend --> 1/Year
Material Usage per Unit --> Material/Widget
Analysis of units error:
Right hand and left hand units do not match
Materials Trend
Has Units: Dimensionless/Year
TREND ( Material Usage per Unit ,
1,
0)
Has Units: Dimensionless
Instead of having "TREND(Material Usage per Unit , 1, 0)" , try creating two new variables,
avgtime = 1 (make sure you use the correct units for avgtime)
initrend = 0 (make sure you use the correct units for initrend)
Then change ""TREND(Material Usage per Unit , 1, 0) " to "TREND(Material Usage per Unit , avgtime , initrend)"
And it should be ok.
Embedding numbers into equations is bad practice, and Vensim interprets these as dimensionless numbers. Putting them in separate equations makes the model easier to read and understand, and allows you to experiment by changing these constants.
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
Re: TREND function --> Units Check
Thank you for this quick and insightful reply.
It did not provide the solution to the problem directly but it certainly tipped me off into the right direction.
In case somebody else should ever face that problem:
In my case Initial Time has "Fraction/Year" as a Unit. This will lead to "1/Year" as a Unit for the TREND variable.
It did not provide the solution to the problem directly but it certainly tipped me off into the right direction.
In case somebody else should ever face that problem:
In my case Initial Time has "Fraction/Year" as a Unit. This will lead to "1/Year" as a Unit for the TREND variable.
-
- Super Administrator
- Posts: 4589
- Joined: Wed Mar 05, 2003 3:10 am
Re: TREND function --> Units Check
I don't think I've ever come across a model that has a time unit of "fraction/year".In my case Initial Time has "Fraction/Year" as a Unit. This will lead to "1/Year" as a Unit for the TREND variable.
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
Re: TREND function --> Units Check
Check the usage in the TREND model in the help system for further usage hints.
/*
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
*/