Time step issues

Use this forum to post Vensim related questions.
Post Reply
usmk
Junior Member
Posts: 4
Joined: Tue Nov 18, 2008 3:06 pm

Time step issues

Post by usmk »

Hi,

I am struggling with the correct usage of the Time Step variable in my model. It is a fairly simple model which should produce a concentration profile (modeled as a Level in Vensim) following an analytical solution, which I first solved in excel. The one complexity is that it uses the erfc function, which I have installed as a Lookup curve in the Vensim model. I have verified that this part of the model functions completely correctly against an excel version of the model (as does the "math" for the rest of the model). There are two issues (in transferring the model from the excel version to Vensim) which I hope can be explained with the Time Step issue:

(1) The concentration profile resulting curve is backwards (mirror image) from the correct solution, and (2) the modeled concentration value is incorrect (for one thing, it should never be able to rise above the "initial concentration" variable, which is set to 1). For example, at time = 10 years (using a time step value of 1 year), the concentration should be 0.1, but in Vensim, the result is 0.27. If I reduce the Time Step value by half (so set it to 0.5), the value for concentration doubles. If I reduce the "initial concentration" value from 1 to 0.1, the concentration result also reduces by the same factor.

While looking for a solution to this problem in this forum, I saw a potential fix by dividing the equation within the Level by the Time Step, so it would look like this:

IF THEN ELSE(Time = 0,
0,
Initial concentration * L* ((EXP(-Y) * ERFC transform1 + EXP(Y) * ERFC transform2)) / TIME STEP
)

Dividing by the Time Step variable unfortunately produced the exact same result as without it...I tried this "trick" in several other places, to no avail. Does anyone have an idea? I feel that the answer must be really simple! I just can't put my finger on it, so to speak!!

Thanks in advance for any advice,
USMK
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Time step issues

Post by Administrator »

Does your model have units and does it pass the dimensional check?
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
usmk
Junior Member
Posts: 4
Joined: Tue Nov 18, 2008 3:06 pm

Re: Time step issues

Post by usmk »

Yes, it passes the units check. But I have found the solution...it was simpler than dealing with time steps...I just thought it must have to do with the time steps due to the way the model was acting when i changed the time step size (because normally this shouldnt affect the results so drastically, it should just improve the accuracy as it decreases)...

Thanks anyway! I was at the end of my list of options when the answer struck! :o)
usmk
Post Reply