Conditionally include a term in an equation

Top  Previous  Next

The conditions

Eq4 . .    xvar+yvar$(qq gt 0)=e=3;

X=sum(I,q(i))$(qq gt 0)+4;

Q(i)=a(i)+1$(a(i) gt 0);

 

each cause the term in red to only be included in an expression (it is treated as zero otherwise) only if the condition is satisfied.

For more on this class of conditionals see the discussion in the Conditionals chapter.