In Chap. 17 of the User Guide, there is this section:
https://www.vensim.com/documentation/21265.html
According to this section, it is possible to select ranges that under the same subscript multiple times. I am trying to do this with the subscript Sector in my model with range [Pharmaceutical Industry, OtherSectors](i am coding it like this because I would like to potentially upscale this to other sectors). However, when I try to do that, my model gives the following error:
Duplicate Subscript Families Found (Sector)
The goal of this code is to assign a number to each pair (sector, sector) when sector ≠ sector
Attached is the model I am working with and a screenshot of my error. Could someone kindly advise me on what I could do to get to the final result?
Multiple Equations for a Subscripted Variable HELP
Multiple Equations for a Subscripted Variable HELP
- Attachments
-
- Screenshot of error
- Screenshot 2025-06-30 181730.png (76.16 KiB) Viewed 4244 times
-
- Screenshot of setting window
- Screenshot 2025-06-30 181722.png (66.76 KiB) Viewed 4244 times
-
- Simple model 4.mdl
- (39.25 KiB) Downloaded 378 times
Re: Multiple Equations for a Subscripted Variable HELP
You've found a glitch that will be fixed in the upcoming release.
You can't literally write,
Price[sector,sector] = blabla
but you can define subscript equivalents,
fromSector <-> sector
toSector <-> sector
and then write,
Price[ fromSector, toSector ] = blabla
However, the equation editor glitch currently forbids this. A temporary workaround is to switch to the text editor. There you will find something like:
Price = A FUNCTION OF( blabla )
Price =
~ unit
~ doc
|
There you can modify it to have the proper subscripts on the left side, like
Price[ fromSector, toSector ] = blabla
~ unit
~ doc
|
When you switch back to sketch view, the editor will be OK with that. Sorry for the temporary inconvenience.
You can't literally write,
Price[sector,sector] = blabla
but you can define subscript equivalents,
fromSector <-> sector
toSector <-> sector
and then write,
Price[ fromSector, toSector ] = blabla
However, the equation editor glitch currently forbids this. A temporary workaround is to switch to the text editor. There you will find something like:
Price = A FUNCTION OF( blabla )
Price =
~ unit
~ doc
|
There you can modify it to have the proper subscripts on the left side, like
Price[ fromSector, toSector ] = blabla
~ unit
~ doc
|
When you switch back to sketch view, the editor will be OK with that. Sorry for the temporary inconvenience.
/*
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
*/