data storage
data storage
Lets say I need to calculate the rate of change for any variables, but I don't know how to store data from the previous time step (T-1)? Can anybody help me please?
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
The thread JJ refers to is
http://www.ventanasystems.co.uk/forum/v ... php?t=3943
See also the molecules. The general formulation for continuous time is
rate of change = (current value - smoothed value)/(smooth time * smoothed value)
smoothed value =SMOOTH(current value,smooth time)
in your example you would replace smooth time with TIME STEP.
http://www.ventanasystems.co.uk/forum/v ... php?t=3943
See also the molecules. The general formulation for continuous time is
rate of change = (current value - smoothed value)/(smooth time * smoothed value)
smoothed value =SMOOTH(current value,smooth time)
in your example you would replace smooth time with TIME STEP.
-
- Senior Member
- Posts: 107
- Joined: Wed Nov 26, 2008 6:12 am
Hi Bob
I tried with your way, as well as followed the link that you mentioned. None of theme worked for me. I am attaching my file for your review.
Thanking you in advance
Khaled
[Edited on 6-22-2010 by khalediwm]
I tried with your way, as well as followed the link that you mentioned. None of theme worked for me. I am attaching my file for your review.
Thanking you in advance
Khaled
[Edited on 6-22-2010 by khalediwm]
- Attachments
-
- variable change.mdl
- (2.59 KiB) Downloaded 210 times
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
For variation use
fractional change = ZIDZ(val - older val,older val)/measurement interval
older val = INTEG((val - older val)/measurement interval,val)
in your model you used TIME STEP as measurement interval and forgot to divide by it in the fractional change equation. The denominator in the fraction really only make sense as older val.
Again see the molecules.
fractional change = ZIDZ(val - older val,older val)/measurement interval
older val = INTEG((val - older val)/measurement interval,val)
in your model you used TIME STEP as measurement interval and forgot to divide by it in the fractional change equation. The denominator in the fraction really only make sense as older val.
Again see the molecules.
Bear in mind that any calculation of derivatives or trends over short times (like TIME STEP) will be very sensitive to noise or discontinuities. If you're modeling a real-world decision, there has to be significant smoothing (which implies delay) in the trend perception process.
Tom
Tom
/*
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
*/
I have same problem with the Sea Level Rise model, Grinsted_v3b‎.vpm.
I saved the file as .htm then changed to vpm ( and tried .mdl too). When I received 'Syntax Error msg when I tried to view as sketch.
I also tried changing character encoding to UTF-8 before saving the model as .htm. No succes.
With DICE model, by using same method, I viewed the model as text but no succes viewing as sketch.
I am not sure if I am missing something.
I saved the file as .htm then changed to vpm ( and tried .mdl too). When I received 'Syntax Error msg when I tried to view as sketch.
I also tried changing character encoding to UTF-8 before saving the model as .htm. No succes.
With DICE model, by using same method, I viewed the model as text but no succes viewing as sketch.
I am not sure if I am missing something.