The “Total number of instances allowed per top model” parameter defines the maximum number of simultaneous instances
of a referenced model that can be used per top model.
Its purposes include:
- Controlling memory usage
- Preventing unintended behavior from blocks that hold state, such as Scope blocks or stateful computations
If set to 1, the referenced model can only be instantiated once at a time.
In your case, one instance is created by the parent model, and another is invoked during linmod,
requiring two instances, thus exceeding the limit and causing an error.
Therefore, the parameter should be adjusted based on use case:
- For simulation only: 1 is sufficient
- For analysis (e.g., linmod) included: set to 2 or more