Subscript range
Posted: Fri Jul 20, 2012 9:16 pm
Hi there,
I'm having an issue trying to build a model with multiple ranges of subscripts.
I have a variable, call it "variable" which has two subscript ranges, "A" and "B" attached to it, such that:
"variable"[A,B]
Within the two subscript ranges are a number of distinct elements, call them "A1", "A2", "B1" and "B2". These are defined in variables, "variable A1", ..., "variable B2"
The value of these variables are combined into two variables (one for each range), "variable A" and "variable B", such that
Eqn 1: "variable A"[A1] = "variable A1"
...
Eqn 4: "variable B"[B2] = "variable B2"
I now want to combine the two variables, "variable A" and "variable B", into "variable" using a similar method:
Eqn 1: "variable"[A] = "variable A"
Eqn 2: "variable" = "variable B"
However, when I try to do this in the equation editor, it removes one of the subscript ranges assigned to "variable" and when checking the model I get the error message:
"Subscript 1 of variable -variable- is a member of -B- family when it should be a member of the -A- family."
Am I using completely the wrong method to assign ranges to different Equations for a variable? Is it not allowed to have different equations within the same variable using different subscript ranges?
I'm lost and would really appreciate any help anyone can offer.
Cheers,
Mik
I'm having an issue trying to build a model with multiple ranges of subscripts.
I have a variable, call it "variable" which has two subscript ranges, "A" and "B" attached to it, such that:
"variable"[A,B]
Within the two subscript ranges are a number of distinct elements, call them "A1", "A2", "B1" and "B2". These are defined in variables, "variable A1", ..., "variable B2"
The value of these variables are combined into two variables (one for each range), "variable A" and "variable B", such that
Eqn 1: "variable A"[A1] = "variable A1"
...
Eqn 4: "variable B"[B2] = "variable B2"
I now want to combine the two variables, "variable A" and "variable B", into "variable" using a similar method:
Eqn 1: "variable"[A] = "variable A"
Eqn 2: "variable" = "variable B"
However, when I try to do this in the equation editor, it removes one of the subscript ranges assigned to "variable" and when checking the model I get the error message:
"Subscript 1 of variable -variable- is a member of -B- family when it should be a member of the -A- family."
Am I using completely the wrong method to assign ranges to different Equations for a variable? Is it not allowed to have different equations within the same variable using different subscript ranges?
I'm lost and would really appreciate any help anyone can offer.
Cheers,
Mik