Hey there! Greetings!
So, is it possible to do so? I'm encounter the same problem where my previous part was equation and then i want to use some of the variable from the previous part to next part(parameter). If yes, how should i correct my equations? Actually i need the model to help me find the Frij and MFij, then the rest of the equation should use parameter section to calculate. But yeah, i encounter the error code "A suffix is missing...", many thanks!
Equation
Eq1 Total MF of supply must equal or less than supply to demand
Eq2a Sending C and N simultaneously from supply to demand side
Eq2b Sending C and N simultaneously from supply to demand side
Eq2c Sending C and N simultaneously from supply to demand side
Eq2d Sending H from supply to demand side
Eq2e Sending O from supply to demand side
Eq2f Sending other components from supply to demand side
Eq3 Total fraction used for each supply must less than 1
Eq4a Sum of demand MF must equal to sum of supply and external supply
Eq4b Sum of demand C must equal to sum of supply and external supply
Eq4c Sum of demand N must equal to sum of supply and external supply
;
Eq1(i).. (MFi(i))=G=sum[(j),MFij(i,j)];
Eq2a(i,j).. MFij(i,j) =E=(Frij(i,j))*[Ci(i)+Ni(i)];
Eq2b(i,j).. Cij(i,j) =E= Frij(i,j)*Ci(i);
Eq2c(i,j).. Nij(i,j) =E= Frij(i,j)*Ni(i);
Eq2d(i,j).. Hij(i,j) =E= [H(i)/C(i)]*[Cij(i,j)];
Eq2e(i,j).. Oij(i,j) =E= [O(i)/C(i)]*[Cij(i,j)];
Eq2f(i,j).. Otherij(i,j) =E=[Other(i)/C(i)]*[Cij(i,j)];
Eq3(i,j).. Frij(i,j)=L=1;
Eq4a(j).. MFj(j)=E=sum[i,MFij(i,j)];
Eq4b(j).. Cj(j)=E=sum(i,Cij(i,j));
Eq4c(j).. Nj(j)=E=sum(i,Nij(i,j));
Eq0F.. OF =E= sum[(i,j),MFij(i,j)]*1;
Parameter
Cmole Carbon mole received by each demand
Hmole Hydrogen mole received by each demand
Omole Oxygen mole received by each demand
Nmole Nitrogen mole received by each demand
;
Cmole(j)=sum[i,Cij(i,j)]/Cmw;
Hmole(j)=sum[i,Hij(i,j)]/Hmw;
Omole(j)=sum[i,Oij(i,j)]/Omw;
Nmole(j)=sum[i,Nij(i,j)]/Nmw;
abhosekar wrote: ↑3 years ago
In your previous code, you defined w as a variable. In this code, you are defining it as a parameter (I think it should be a variable). This will be enough to get rid of your error.
I see that you have -w(i) in the objective which makes me rethink my constraints. If you are maximizing your objective, then the current constraints should work.
However, if you are minimizing, we need to do more.
eq5(i)..w(i)=l=sum(j, K(i,j)*x(j))+Mi*(1-x(i));
eq5a(i)..w(i)=g=sum(j, K(i,j)*x(j))-Mi*(1-x(i));
eq6(i)..w(i)=l=Mi*x(i);
eq6a(i)..w(i)=g=-Mi*x(i);
This is a better way.
- Atharv