When I put these statements in a file named amplerrors.txt, and then read that file into AMPL, I see this error message:
ampl: include amplerrors.txt;
..\amplerrors.txt, line 27 (offset 578):
Cg is not defined
context: sum{i in N} >>> (Cg[i]*G <<< [i,t] + COg[i]*G[i,t]) +
This error occurs because Cg
is used in your objective function, but there is no definition of Cg
in any param or var statement in your model. Usually the reason for this error is one of the following:
- You used a param or var but forgot to define it.
- There is a mistake in typing a param or var name, either in its definition or in the place where it is used.