Question: How to use for loop? Objective function contain piecewise function?

How to use for loop in the optimization function? The objective function contain piecewise function, in that case what to do?
Can anyone help me with the syntax? I am attaching the sheet below:
Question_loop.mw

Please Wait...