Need help to formulate following conditionals in linear equations

I want to formulate the set of linear equations for the following conditions:

Q(i) = 0, if y(i) = 1

Q(i) = P(i), if  sum(i,y(i)) = 0

Q(i) =P(i-r), if sum(i,y(i))$(ord(i)<r) and y(i)$(ord(i)=r)=1 and y(i) =0

Here

set i,r;

alias(i,r);

Parameter P(i) "arbitrary vector of length i";

Variable Q(i)

Binary Variable y(i)

I want linear equations so that I can use it in solving a MIP problem

Thank you.

Search for logical constraints in the forum. Many examples. I also often recommend the book by HP Williams. -Michael

Thank you for your reply. Can you please reply the name of the book. Thanks

Model Building in Mathematical Programming

Thank you for your reply.

Basically, I found the way , I should formulate the problem.

However, modelling the problem in linear terms has become the problem for me.

Please see this link : https://math.stackexchange.com/questions/4235264/help-required-to-formulate-a-linear-system-with-the-following-constraints


Can you , if possible, help me to formulate the above conditions with linear equations?

Thank you.