# Big M method for continuous variables

Is there any way to model the big M method for continuous variables? Something similar to this but $$B, C \in \mathbb{R}_{\geq 0}$$ and $$A\in\{0,1\}$$.

Due to the precision problem, when the $$B$$ and $$C$$ are close I do not get the correct answer.

Let $$p_{i,j} \in \mathbb{R}_{\geq 0}$$, for $$i=1,\dots, n, j=1, \dots, m$$. As one of the constraints of my problem, I am looking for $$h$$ such that $$g_i(h) := \sum_{j=1}^h p_{i,j} < 1.$$ To find $$h$$, I defined $$a_{i,j} \in \{0,1\}$$ such that $$a_{i,h} = \begin{cases} 1 \qquad \text{if } g_i(h) < 1 \quad h=1, \dots, m, \\ 0 \qquad \text{otherwise}. \end{cases}$$

To implement the if condition above, I used the big-M method, but the problem is that the big-M method works well for ILPs while the variable, here $$p$$, is non-integer. When $$g_i(h)$$ is very close to 1 but not absolutely 1 due to the precision of the number, say $$g_i(h)=1-10^{-16}$$, then $$g_i(h)$$ which actually is 1 will not be assumed as 1 by the program, and the program does not return the correct value for $$h$$. I was wondering if there is a trick for this issue.

• What's the "big M method"? Dec 5 '18 at 18:56
• "I do not get the correct answer". Whenever you get an error, it is almost compulsory to write it out in detail. Please provide a Minimal, Complete, and Verifiable example. Dec 5 '18 at 21:29
• @Apass.Jack I have updated the question. As I told, a similar question is here: cs.stackexchange.com/questions/69531/… Dec 5 '18 at 22:31
• This seems more appropriate for Computational Science. Dec 6 '18 at 5:09