# Deriving KKT Conditions for time-step equations

I have a variable $$e(h)$$, and below is the part of the Lagrangian equation where I am taking the derivative with respect to $$e(h)$$.

$$\frac{\partial }{\partial e(h)} \hspace{.2cm}\mu_1(h)(e(h)-\bar{E})+\mu_2(h)(e(h)-e(h-1))$$

where $$\bar{E}$$ is a parameter and the rest are variables. $$h$$ defines the time steps in hours. Please let me know how to take the derivative to derive the KKT especially the part where the $$e(h-1)$$ is present.

• If $e(h)$ and $e(h-1)$ are different variables, then the derivative of $e(h-1)$ with respect to $e(h)$ is zero. May 25, 2020 at 1:14
• $e(h)$ and $e(h-1)$ are the same variable, it's just the time step is different. May 25, 2020 at 1:16
• What does a solution look like to you? If it is a list of values for $e(h)$ for each finite number of possible $h$ values, then these are different variables. May 25, 2020 at 1:21
• Ok, thank you for that. May 25, 2020 at 1:29
• Is there any relationship between $\mu_1(h)$ and $e(h)$ or are they independent? Could you say something regarding $\mu_1(h)$'s partial derivative in terms of $e(h)$ May 25, 2020 at 15:46