Hello
I had a subscript called TECH: hs, rr, nuc
Then i created another subscript (PDC) taking all the elements from 'TECH' and added a new one (lti), i.e., PDC: hs, rr, nuc, lti
When I run the model, i get this error: "All arrays must have same size last element for REORDER"
Before creating the subscript 'PDC', the model run perfectly.
Does anyone know what is happening?
Adding a subscript using elements of other subscript
Re: Adding a subscript using elements of other subscript
Are you using a VECTOR REORDER with PDC on the LHS and Tech on the RHS of the equation?
Hard to tell without seeing the equations in question.
Hard to tell without seeing the equations in question.
/*
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: Adding a subscript using elements of other subscript
I did not even used the subscript 'PDC'. I just created it and I got this error
Re: Adding a subscript using elements of other subscript
A function you've used may be expecting a complete range rather than a subrange, and the addition of the new subscript converts TECH to a subrange. Hard to tell without an example though.
/*
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: Adding a subscript using elements of other subscript
In the following example i have a subscript tech:(p1,p3) and all the equations use tech
Then, i created the subscript 'pdc': tech, p4
If you remove it, the model works again
See the file I attach
Thank you
Then, i created the subscript 'pdc': tech, p4
If you remove it, the model works again
See the file I attach
Thank you
- Attachments
-
- subscripts and subranges.mdl
- (11.5 KiB) Downloaded 193 times
Re: Adding a subscript using elements of other subscript
It seems that VECTOR REORDER does not work with subranges... I can create a new vector PCD: hs1,rr1,nuc1,lti1 and then create a subrange let's say PDCsub: hs1,rr1,nuc1->Tech, in case i need to do some calculation with both. Do you have another suggestion?
P.s. You might add the use of subranges in this kind of function as a possible improvement
P.s. You might add the use of subranges in this kind of function as a possible improvement
Re: Adding a subscript using elements of other subscript
It may work with subranges (I don't recall), but I think that's not quite the issue. You have several instances of mixed subscript uses - for example:
vector reorder(Desired expansion x hour[HOUR,EXPN2],price order inc[HOUR,TECH])
I think it's checking the size of the TECH family (=PDC) against EXPN2, and reporting the error because this is 4 vs. 3. This could be overzealous checking - I'll have to look at the code.
I'm surprised that it worked before, because you don't have TECH mapped to EXPN2.
vector reorder(Desired expansion x hour[HOUR,EXPN2],price order inc[HOUR,TECH])
I think it's checking the size of the TECH family (=PDC) against EXPN2, and reporting the error because this is 4 vs. 3. This could be overzealous checking - I'll have to look at the code.
I'm surprised that it worked before, because you don't have TECH mapped to EXPN2.
/*
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
*/