Page 1 of 1

Multiple Equations for a Subscripted Variable HELP

Posted: Mon Jun 30, 2025 4:28 pm
by allelly_m
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?

Re: Multiple Equations for a Subscripted Variable HELP

Posted: Mon Jun 30, 2025 5:06 pm
by tomfid
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.