I am in the process of translating some MATLAB code into Python. There is one line that is giving me a bit of trouble:
[q,f_dummy,exitflag, output] = quadprog(H,f,-A,zeros(p*N,1),E,qm,[],[],q0,options);
I looked up the documentation in MATLAB to find that the quadprog function is used for optimization (particularly minimization).
I attempted to find a similar function in Python (using numpy) and there does not seem to be any.
Is there a better way to translate this line of code into Python? Or are there other packages that can be used? Do I need to make a new function that accomplishes the same task?
Thanks for your time and help!
scipy.optimize
? NumPy only has the basic stuff for working with arrays of numbers; SciPy builds a bunch of other math and science stuff on top of it, including a variety of optimization algorithms. – Elihuquadprog
, and there's Python bindings for something called QuadProg++, and I'm sure there are others as well. (Some of them may not be built on top of NumPy, however.) But at that point, this becomes a library-recommendation question, and Stack Overflow is unfortunately not the place to find those. – Elihu