Introduction to Optimization in Python
Jasmin Ludolf
Content Developer
Objective function:
Objective function:
$p = 40q - 0.5q^2$
Derivative: slope of the objective function changes with changes to single variable
$\frac{dp}{dq} = 40 - q$
Objective function:
$F = K^{0.34} \times L^{0.66}$
Partial derivatives: how the slope changes with respect to each variable
$\frac{\partial F}{\partial K}$ and $\frac{\partial F}{\partial L}$
Objective function:
from sympy import symbols, diff, solve
K, L = symbols('K L') F = K**.34 * L**.66
dF_dK = diff(F, K) dF_dL = diff(F, L)
crit_points = solve([dF_dK, dF_dL], (K, L))
print(crit_points)
[]
Objective function:
Watch out for:
Introduction to Optimization in Python