Create variable while the simulation is running
-
- Senior Member
- Posts: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
Create variable while the simulation is running
Hello Admin, Tom, and Team
I'm here again with my (some of my friend said, ridiculuos) question. But first, thanks so much for always come out with a solution or at least something that can help me to resolve my problem with SD.
Anyway, i would like to ask regarding on variable.
In my model, i'm planning to create generation unit based on additional generation that i got earlier in the model.
But the issue is, the generation capacity kept increased yearly. Attached is the sub-model that i'm working on and the output from the model.
That hydro generation need to be divided into few units which can go up to 200 units since it depends on the generation needed. So i have no idea how do i put my variables for the units. Can SD create variables while the simulation is running?
I don't know if my question is clear enough or not, but i am really looking forward for your help. I've been stuck with this since 2 weeks ago
Thanks in advance, mate.
I'm here again with my (some of my friend said, ridiculuos) question. But first, thanks so much for always come out with a solution or at least something that can help me to resolve my problem with SD.
Anyway, i would like to ask regarding on variable.
In my model, i'm planning to create generation unit based on additional generation that i got earlier in the model.
But the issue is, the generation capacity kept increased yearly. Attached is the sub-model that i'm working on and the output from the model.
That hydro generation need to be divided into few units which can go up to 200 units since it depends on the generation needed. So i have no idea how do i put my variables for the units. Can SD create variables while the simulation is running?
I don't know if my question is clear enough or not, but i am really looking forward for your help. I've been stuck with this since 2 weeks ago
Thanks in advance, mate.
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Create variable while the simulation is running
I don't understand what you are trying to do.
Are you trying to allocate the hydro generation to something?
Are you trying to allocate the hydro generation to something?
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
-
- Senior Member
- Posts: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
Re: Create variable while the simulation is running
Sorry for my bad command. I actually don't know how to put it into words.Administrator wrote: ↑Wed Jul 01, 2020 6:05 am I don't understand what you are trying to do.
Are you trying to allocate the hydro generation to something?
OK what i want to do is, from the output of Hydro Generation, i want to divide the output into smaller generation units.
For instance, in year 12, the out of Hydro Generation gives 48.01MW. In year 13, it gives a total of 333.45 MW.
So from this figure i want to split it into smaller value. For example, i want to have a variable named Unit 1 for only 200MW, and Unit 2 for the remaining MW of Year 13. And this Unit can go up to Unit 200 (as shown below) since the value of Hydro Generating will increased yearly. How do i did that?
Did i make the question clearer?
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Create variable while the simulation is running
I'd use subscripts. Here is some Vensim structure that will allocate the hydro generation on a proportional basis to all 200 units based on their relative demand.
Code: Select all
unit : (unit 1-unit 200)
demand[unit] = 200, 300, 400 etc
total demand = sum(demand[unit!])
relative demand = zidz ( demand[unit] , total demand )
allocation[unit] = hydro generation * relative demand
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: Create variable while the simulation is running
If the units are all the same size, you don't really need them active discretely. You could instead have a variable representing number of units active, and with generation = N units active * unit size.
If the units are discrete and come online in different years, then you could do something like:
unit size[unit] = 100, 300, 200, ... ~ MW
unit in service year[unit] = 2001, 2003, 2004, 2009, ... ~ year
capacity[unit] = STEP( unit size[unit], unit in service year[unit] )
If the units are discrete and come online in different years, then you could do something like:
unit size[unit] = 100, 300, 200, ... ~ MW
unit in service year[unit] = 2001, 2003, 2004, 2009, ... ~ year
capacity[unit] = STEP( unit size[unit], unit in service year[unit] )
/*
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
*/
Re: Create variable while the simulation is running
In general, if total capacity is large, and individual units are small, adding discreteness is not going to add much to the model, unless perhaps the purpose is something short term and tactical. I would consider not disaggregating the units.
/*
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
*/
-
- Senior Member
- Posts: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
Re: Create variable while the simulation is running
I'm sorry, but can you help me by showing the example of the model. I tried to understand the text, but i failed big time.
I'm so sorry if i'm asking way too much favor from you guys.
Thanks soooo much in advance.
I'm so sorry if i'm asking way too much favor from you guys.
Thanks soooo much in advance.
Re: Create variable while the simulation is running
I think we need to know more about the problem we're trying to solve here. What is the motivation for discrete generating units? Is it so they can be turned on/off individually? So that capacity grows in steps instead of smoothly? Something else?
/*
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
*/
-
- Senior Member
- Posts: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
Re: Create variable while the simulation is running
Yes, Tom The motivation for discrete generating units is to calculate their marginal cost for each unit when each unit have to distribute power at different value of generations. This will then effects my calculation for the electricity tariff.
-
- Senior Member
- Posts: 80
- Joined: Sun Feb 02, 2020 5:10 am
- Vensim version: DSS
Re: Create variable while the simulation is running
I'm still praying that someone can help me :'(