I am trying the formulate if conditions.
i=1...10 p=1...5 j=1...50 k=1...7
C_ijpk=b_ik+LC_ik+CC_ik ∀ijt k∈ {1,2,3}
I have three different LC_ik values and also two different coefficient CC_ik. in my formula, these coefficients connection with age_ijpk and J_i.
İf age is changing LC_ik will change. And if the scenario(j) is changing CC_ik will change.
>
how can I convert an IF condition to a mathematical equation?
C_ijpk= b_ik+LC_ik (if ageijpk <=60) or LC_ik (if ageijpk >60 and <=140) or LC_ik (if ageijpk >140)+CC_ik (if Ji < 100 or CC_ik (if Ji = 100).
AIMMs code.
if AgeAft(i,j,t)<=60 then
bikf(i)+LCik1(i)
elseif AgeAft(i,j,t)>60 and AgeAft(i,j,t)<=140 then
bikf(i)+LCik2(i)
elseif AgeAft(i,j,t)>140 then
bikf(i)+LCik3(i)
endif;
Best regards.
It strongly depends on what you want to do next. As an example, $$y(x) = \begin{cases}a \mbox{ if } x\ge c, \\ b \mbox{ if }x<c \end{cases}$$ can be imlemented as $$ y(x) = a\, \frac{1 + \mathrm{sgn}(x-c)}{2} + b\,\frac{1 - \mathrm{sgn}(x-c)}{2}, $$ where $\mathrm{sgn}$ is the sign function defined at zero as $\mathrm{sgn}(0)=1$. Note that this definition of $\mathrm{sgn}$ also implicitly involves IF.