# Objective function change

(So i was trying to find how to allocate my stats in my rpg character and i stumble across something i don't know how to formulate):

Maximize $$Z = \frac{x_1}{100}*\left(1+\frac{x_2}{100}\right)*(bd+0.5*x_1) + \left(1-\frac{x_1}{100}\right)*(bd+0.5*x_1)$$ ($$bd$$ is constant) subject to:
$$x_1 \geq 41$$ $$x_2 \geq 40$$ $$x_1 + x_2 \leq 2000$$ $$x_j \geq 0$$ $$x_1, x_2 \text{integer}$$

$$\frac{x_1}{100}$$ in the first term of objective function represent a probability and $$\left(1-\frac{x_1}{100}\right)$$ the complement.

My problem is that when $$x_1>100$$ i want my objective function to take account only the first term $$\left(1+\frac{x_2}{100}\right)*(bd+0.5*x_1)$$ with $$\frac{x_1}{100}=1$$ (so the second term isn't considered $$\left(1-\frac{x_1}{100}\right)=0$$). I thought of using integer variables but i don't know how to formulate the model. (I solved it in excel with if function but i want to know the analytic version)

(Background: $$x_1$$ points of stat 1 (Dexterity) and in this game it contributes to critical chance and damage, where as $$x_2$$ (Cunning) contributes to critical damage)

If there is another way to formulate, i'll be glad to see it.

• Can you use $\LaTeX$ please? – Dr. Sonnhard Graubner Dec 10 '19 at 14:00