Create variable while the simulation is running

Use this forum to post Vensim related questions.
Post Reply
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Create variable while the simulation is running

Post by husnafezaahmad »

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.
Screen Shot 2020-07-01 at 13.30.13.png
Screen Shot 2020-07-01 at 13.30.13.png (192.16 KiB) Viewed 3609 times
Screen Shot 2020-07-01 at 13.27.07.png
Screen Shot 2020-07-01 at 13.27.07.png (107.93 KiB) Viewed 3609 times


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.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Create variable while the simulation is running

Post by Administrator »

I don't understand what you are trying to do.

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
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Re: Create variable while the simulation is running

Post by husnafezaahmad »

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?
Sorry for my bad command. I actually don't know how to put it into words.

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.

Screen Shot 2020-07-01 at 14.11.04.png
Screen Shot 2020-07-01 at 14.11.04.png (224.23 KiB) Viewed 3602 times

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?

Screen Shot 2020-07-01 at 14.17.08.png
Screen Shot 2020-07-01 at 14.17.08.png (145.6 KiB) Viewed 3602 times
Did i make the question clearer?
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Create variable while the simulation is running

Post by Administrator »

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
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Create variable while the simulation is running

Post by tomfid »

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] )
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Create variable while the simulation is running

Post by tomfid »

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.
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Re: Create variable while the simulation is running

Post by husnafezaahmad »

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.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Create variable while the simulation is running

Post by tomfid »

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?
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Re: Create variable while the simulation is running

Post by husnafezaahmad »

tomfid wrote: Wed Jul 01, 2020 2:48 pm 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?
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.
husnafezaahmad
Senior Member
Posts: 80
Joined: Sun Feb 02, 2020 5:10 am
Vensim version: DSS

Re: Create variable while the simulation is running

Post by husnafezaahmad »

I'm still praying that someone can help me :'(
Post Reply