Page 1 of 1

Unit error when using delay

Posted: Fri Mar 11, 2016 2:49 pm
by Hamilton
Hi.

Consider the attached model. When I use a dimensionless auxiliary variable with a delay function I got this kind of message regarding error on units:

***********************************************
Error in units for the following equation:
#Auxiliary variable>DELAY3>LV2# =
INTEG( #Auxiliary variable>DELAY3>RT1#
- #Auxiliary variable>DELAY3>RT2# ,
#Auxiliary variable>DELAY3>LV3# )
#Auxiliary variable>DELAY3>LV2# --> Dmnl
#Auxiliary variable>DELAY3>RT1# --> Dmnl
#Auxiliary variable>DELAY3>RT2# --> Dmnl
#Auxiliary variable>DELAY3>LV3# --> Dmnl

Analysis of units error:
Units missmatch in INTEG
#Auxiliary variable>DELAY3>RT1#
- #Auxiliary variable>DELAY3>RT2#
Has Units: Month
#Auxiliary variable>DELAY3>LV3#
Has Units: Dimensionless

***********************************************

What I get from this message is that a delay function implies some kind of temporal unit and this causes the error. How can I correct it?

Thank you.

Re: Unit error when using delay

Posted: Fri Mar 11, 2016 4:07 pm
by tomfid
The delay duration has units of months. When it's buried in an equation as a number (12), it's effectively dimensionless, so you need to pull it out as a named variable with units, which also has the benefit of exposing the assumption to testing. There were two other implicit parameters in the model. See attached.
unit problem 2.mdl
(2.68 KiB) Downloaded 246 times

Re: Unit error when using delay

Posted: Fri Mar 11, 2016 6:55 pm
by Hamilton
Dear Tom,

Thank you so much!