Code of one Constraint Topic is solved

Problems with modeling
Post Reply
mr_khdm
User
User
Posts: 1
Joined: 2 weeks ago

Code of one Constraint

Post by mr_khdm » 2 weeks ago

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

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.
Please help me, How I can fix it?

TNX

User avatar
bussieck
Moderator
Moderator
Posts: 353
Joined: 3 years ago

Re: Code of one Constraint

Post by bussieck » 2 weeks ago

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

Post Reply