Multiple Equations for a Subscripted Variable HELP

Use this forum to post Vensim related questions.
Post Reply
allelly_m
Junior Member
Posts: 2
Joined: Mon Jun 30, 2025 3:55 pm
Vensim version: DSS

Multiple Equations for a Subscripted Variable HELP

Post 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?
Attachments
Screenshot of error
Screenshot of error
Screenshot 2025-06-30 181730.png (76.16 KiB) Viewed 4243 times
Screenshot of setting window
Screenshot of setting window
Screenshot 2025-06-30 181722.png (66.76 KiB) Viewed 4243 times
Simple model 4.mdl
(39.25 KiB) Downloaded 378 times
tomfid
Administrator
Posts: 4027
Joined: Wed May 24, 2006 4:54 am

Re: Multiple Equations for a Subscripted Variable HELP

Post 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.
Post Reply