csu-hmc / opty

A library for using direct collocation in the optimization of dynamic systems.
http://opty.readthedocs.io
Other
86 stars 20 forks source link

cvxpy has a very nice optimization API that could be useful to mimic for objective functions #84

Open moorepants opened 6 years ago

moorepants commented 6 years ago

https://github.com/cvxgrp/cvxpy

tvdbogert commented 6 years ago

I am not qualified to comment (but will do so anyway...). I assume you mean long term.

My concern would be (and that's already a concern with current opty perhaps) that sometimes we just want to provide a function that computes the objective (and gradient), rather than provide it symbolically and use symbolic differentiation.

We have recently created objectives with IMU tracking, and with metabolic energy consumption. Those aren't simple expressions. Maybe I do not appreciate the capabilities of symbolic manipulation.

moorepants commented 6 years ago

The current implementation in opty requires you to write a numeric function that returns the objective and its gradient.

I'd like to add the functionality to supply symbolic objectives. This cvxpy seems to have some builtin functions that let you setup common types of objective functions with a high level API, which I think is nice.

In the end, it'd be nice to support both numeric and symbolic functions for the objective and the constraints. You can basically do this now as it stands if you write either of them manually.