Skip to main content
1 of 3
hhh
  • 301
  • 4
  • 18

Which program to solve Lagrange equation with partial derivatives and ability to variate many variables?

I need to solve partial derivatives for:

$L=\frac{1}{2}\sum_{i=1}^{n} w_{i}^{2}\sigma_{i}^{2} -\lambda \left( \sum_{i=1}^{n} w_{i} \bar{r_{i}} - \bar{r} \right) -\mu \left( \sum_{i=1}^{n} w_{i}-1 \right)$

with 5 vars, I get 5 partial derivatives $\frac{\partial L}{\partial w_{1}}$, $\frac{\partial L}{\partial w_{2}}$, $\frac{\partial L}{\partial w_{3}}$, $\frac{\partial L}{\partial \lambda}$ and $\frac{\partial L}{\partial \mu}$ with which I need to solve the $w_{1}$, $w_{2}$ and $w_{3}$. For all $i$, $\sigma_{i}$ is known. I don't want to manually derivate, it could be more cumbersome with more restrictions. Later, I need to find the point where the minimum variance is located i.e. to find out the optimal values for $\lambda$, $\mu$ and $w_{i}$ for all $i$ where $i\in\{1,2,3\}$. I need to variate the 5 vars to find the optimal solutions (a bit like in excel but no such thing currently available) and then show the frontier grapfically. So my question is which program would you use to solve such thing?

hhh
  • 301
  • 4
  • 18