Hi,

I am new to this group. I am a PhD student working in mosel xpress.

I have few questions to start with,

1. When to use (=) and when to use ( := ). I am not sure about that.

2. Also I am getting error msg:

error101: incompatible types in assignment ('real' = 'linctr' not defined )

forall(t in T|t>2)I(t) := sum(j in J) (C(j,t)+ C(j,t-1)+ C(j,t-2))*2/3 +

sum(j in J)(TC(j,j)*Z(j,t)) +

sum(j in J,k in K)(PC(j,k)*L(k,j,t))

Looking forward for your respnse.

Regards,

Riz

The '=' operator serves for defining constants within 'parameters' or 'declarations' block,

in most other contexts, this operator sign stands for comparison.

The ':=' operator is Mosel's assignment operator.

For defining a constraint relation (equality constraint) you need to use '=', in your example:

forall(t in T|t>2) I(t) = sum(j in J) (C(j,t)+ C(j,t-1)+ C(j,t-2))*2/3 + ...

If you want to name these constraints in order to be able to refer to them from other places in the model,

you need to use the assignment operator as follows:

forall(t in T|t>2) MyCtr(t) := I(t) = sum(j in J) (C(j,t)+ C(j,t-1)+ C(j,t-2))*2/3 + ...