E-TE0509 — Invalid OMMX coefficient

Error Type

Type Error

Phase

compiling the model to an OMMX instance

Python exception

ValueError

Message

Invalid coefficient for the OMMX instance: {...}.

The instance format stores each coefficient as a finite, non-zero number.

Possible fix: look for NaN or infinite values in the instance data, and for constant parts of the model's expressions that evaluate to NaN, infinity, or exactly zero.

Cause

A coefficient in the compiled objective or constraints is not a finite, non-zero number as the OMMX instance format requires. Typically it is NaN or infinity produced by problematic instance data or by an overflow such as division by a tiny value, or a constant part of an expression that evaluates to exactly zero.

Fix

Check your instance data for NaN or infinite values (e.g. numpy.isnan / numpy.isinf) and inspect expressions that could overflow or divide by (near-)zero. The reason in the message tells you whether the offending coefficient was zero, infinite, or NaN.