## Code of one Constraint Topic is solved

Problems with modeling
mr_khdm
User Posts: 4
Joined: 7 months ago

### Code of one Constraint

Hello
I have a problem with one of the constraints of my model.
this constraint is: and I code this:

Code: Select all

``co13(j,k,s)  .. pi0(j,k,s) =e= sum(nn,Power(landaa(j,k,s)/mu(k,s),nn)) * (1/fact(nnn)) + (1/fact(B(j,k,s))) * (power(landaa(j,k,s)/mu(k,s),B(j,k,s))) * (1-(landaa(j,k,s)/(B(j,k,s)*mu(k,s))))   ;``
But GAMS tell me Error 148: Dimension different – The symbol is referenced with more/less indices as declared.
All of my parameters are correct and I checked these.

TNX

bussieck
Moderator Posts: 483
Joined: 3 years ago

### Re: Code of one Constraint

Look further. There is another error at the same location "**** 201 Invalid argument for function". nn is a set (element) and not a number. If the set elements of nn can be interpreted as a numbers e.g. "1","2","3",... then replace nn by nn.val. Otherwise create a parameter that maps nn to a value. There are more error. You use nnn and close the sum too early... The following compiles. I have not checked if this really represents your formula:

Code: Select all

``````alias (*,j,k,s,nn);
variables pi0,landaa,mu,B;
equation col3;
col3(j,k,s).. pi0(j,k,s) =e= sum(nn,Power(landaa(j,k,s)/mu(k,s),nn.val) * (1/fact(nn.val)) + (1/fact(B(j,k,s))) * (power(landaa(j,k,s)/mu(k,s),B(j,k,s)))) * (1-(landaa(j,k,s)/(B(j,k,s)*mu(k,s))))   ;``````
-Michael