Hi, I see the instructions on how to change attribute values. The manual says that it's also possible to change stock values or the values of flows related to stocks but I'm not clear on how this is done. Specifically, I would like a triggered action to record the value of an external time series data variable in a stock. Stock is preferable to attribute as the value should be numerical not a string. It would be helpful to know how command actions can change both stock values directly and via once-off changes to flows.
Thank you
Using actions to change stock values
-
- Junior Member
- Posts: 2
- Joined: Wed May 09, 2018 3:56 pm
- Vensim version: PLE
Re: Using actions to change stock values
1. Drag a copy of the target stock onto the action diagram (using the parent or invoker reference)
2. Add an inflow to the stock.
3. Set the inflow equation for the stock to = newValue-stock
Note that the units on this flow are the same as the stock (unlike a normal dynamic equation where flow = stock/time).
2. Add an inflow to the stock.
3. Set the inflow equation for the stock to = newValue-stock
Note that the units on this flow are the same as the stock (unlike a normal dynamic equation where flow = stock/time).
/*
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
*/