'Vec elm map' error

Use this forum to post Vensim related questions.
Post Reply
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

'Vec elm map' error

Post by RWTH_FCN »

Hi,
I have one constant variable in the model as ‘Wind production as Fraction of Peak’ which it has two subscripts ( day of year ,hour of day). This variable is used in another variable called ‘wind onshore production this hour’ which its formula is as follows:

Wind onshore production this hour[Enduse Region]= vector elm map(Wind Onshore Production as Fraction of Peak[day 1,h1]
,MODULO(hour of year/Hour unit+EndUse Region-1-1,Hours per Year/Hour unit*year unit))

I have changed the format of ‘Wind production as Fraction of Peak’ that it has three subscripts (Enduse Region, day of year, hour of day) right now.
New formula:
Wind onshore production this hour[Enduse Region]= vector elm map(Wind Onshore Production as Fraction of Peak[Enduse Region 1, day 1,h1]
,MODULO(hour of year/Hour unit+EndUse Region-1-1,Hours per Year/Hour unit*year unit))

When I run model I encounter this error:
VECTOR_ELM_MAP outside array bounds

I would like to ask you how to change formula, considering new subscript format to fix this error?

Best Regards,
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: 'Vec elm map' error

Post by Administrator »

I'd start by simplifying things. First of all create a new parameter that is
parameter 1 = hour of year/Hour unit+EndUse Region-1-1
and one that is
parameter 2 = Hours per Year/Hour unit*year unit

Now a 3rd parameter = MODULO(parameter 1,parameter 2)

And see what the value of this is. My guess is that it is lower/greater than the number of subscript elements.
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
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Re: 'Vec elm map' error

Post by RWTH_FCN »

Administrator wrote: Sat Dec 29, 2018 8:41 pm I'd start by simplifying things. First of all create a new parameter that is
parameter 1 = hour of year/Hour unit+EndUse Region-1-1
and one that is
parameter 2 = Hours per Year/Hour unit*year unit

Now a 3rd parameter = MODULO(parameter 1,parameter 2)

And see what the value of this is. My guess is that it is lower/greater than the number of subscript elements.
Thanks for your response. I created proposed parameters, but I still get same error.
The thing is that in the last model I had 2 subscripts for "Wind onshore production this hour", but I have added one more subscript to it. So, can it be problematic as I have not changed subscript of the formula?
As it can be seen in the picture in left side, there were 2 subscripts and it works, but in right side it seems that adding one more subscript cause that error.
Attachments
Vec elm map.png
Vec elm map.png (35.08 KiB) Viewed 4250 times
LAUJJL
Senior Member
Posts: 1421
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: 'Vec elm map' error

Post by LAUJJL »

Hi

Avoid using the vector elm map function go to

viewtopic.php?f=2&t=3192&p=22055&hilit= ... map#p22055

It is good too setting the use stricte testing in the model<settings<units equiv window

Regards.

JJ
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Re: 'Vec elm map' error

Post by RWTH_FCN »

LAUJJL wrote: Sun Dec 30, 2018 1:30 pm Hi

Avoid using the vector elm map function go to

viewtopic.php?f=2&t=3192&p=22055&hilit= ... map#p22055

It is good too setting the use stricte testing in the model<settings<units equiv window

Regards.

JJ
Thanks for the help. Can you help me how to use "If then else" format like your proposed link instead of Vec elm map for this example:
This is my formula:
Wind onshore production this hour[Enduse Region]= vector elm map(Wind Onshore Production as Fraction of Peak[Enduse Region 1, day 1,h1]
,MODULO(hour of year/Hour unit+EndUse Region-1-1,Hours per Year/Hour unit*year unit))

Renge of subscripts is as follows:
Enduse Region:1-28
day of year:1-365
hour of day:1-24

Best Regards,
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: 'Vec elm map' error

Post by Administrator »

Can you upload your model? I did not realise that "hour of day" is a subscript. It really helps us to help you if you can upload things so we can see exactly what you are doing.
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
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Re: 'Vec elm map' error

Post by RWTH_FCN »

Administrator wrote: Sun Dec 30, 2018 3:27 pm Can you upload your model? I did not realise that "hour of day" is a subscript. It really helps us to help you if you can upload things so we can see exactly what you are doing.
Unfortunately, I cannot upload the model. However, I have attached the graph and formula of respective part.
As you can see for calculating "Reg WindOn 80m high production this hour" I need "WindOn 80m high production this hour". This variable uses 'vec elm map' function for using data of input(blue variable). In last version, I had only 'day of year' and 'hour of day' as subscripts but I added 'Enduse region' to them(B Region is first region). In other words, I have one input(WindOn 80m high) with 3 subscripts and I am using it in "WindOn 80m high production this hour" with attahced formula. As I have added new subscript to it I think some changes have to be implemented in formula of "WindOn 80m high production this hour" to fix that error.
I would be grateful if you could help me with this description.
Attachments
WDloop.png
WDloop.png (72.47 KiB) Viewed 4239 times
LAUJJL
Senior Member
Posts: 1421
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: 'Vec elm map' error

Post by LAUJJL »

Hi

There are two difficulties in your formulation.

The first is the correct use of the vector elm map and the possibility to use a simpler formula as explained in the link above or eventually the vector select explained by Tom.
And once you are able to use a simpler formulation of the vector elm map, then try to use it in your specific formulation.

I then propose that you try to get familiar first with my or Tom's formulation with a simple model like the one I explained with the three subscripts and once you are able to built such a model, than it will be time to built the rest of the formula.

See the example joined three_subscripts.mdl.

Regards.

JJ
Attachments
three_subscripts.mdl
(2.45 KiB) Downloaded 194 times
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Re: 'Vec elm map' error

Post by RWTH_FCN »

LAUJJL wrote: Sun Dec 30, 2018 5:57 pm Hi

There are two difficulties in your formulation.

The first is the correct use of the vector elm map and the possibility to use a simpler formula as explained in the link above or eventually the vector select explained by Tom.
And once you are able to use a simpler formulation of the vector elm map, then try to use it in your specific formulation.

I then propose that you try to get familiar first with my or Tom's formulation with a simple model like the one I explained with the three subscripts and once you are able to built such a model, than it will be time to built the rest of the formula.

See the example joined three_subscripts.mdl.

Regards.

JJ
Thanks a lot for your proposed model. I used correct format of 'vec elm map' and it is working now.
Post Reply