'Using Linear programming, how can I implement a conditional constraint with variables involving time steps? [closed]

first time posting on SO as I am usually able to find the answers I need from previous posts, but I'm really stuck with this one.

I'm using linear programming to optimise a problem with variables which have different time steps and I'm trying to implement a conditional constraint.

My constraints are:

IF q(t+1) > 0

THEN q(t) = z(t) for t < t(max)

where q and z are variables and t, t+1 and t(max) represent the current, next and final time steps respectively.

I have tried formulating the conditional restraints using an indicator variable and a large upper bound value, M, in a number of different ways, but so far I'm having no success.

Any help anyone could provide would be greatly appreciated.

Thanks :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source