https://github.com/casadi/optoy
Because optimization is fun!
https://github.com/casadi/optoy
Last synced: 6 months ago
JSON representation
Because optimization is fun!
- Host: GitHub
- URL: https://github.com/casadi/optoy
- Owner: casadi
- License: lgpl-3.0
- Created: 2014-10-21T13:32:37.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-06T22:48:07.000Z (about 10 years ago)
- Last Synced: 2025-03-27T04:12:56.653Z (7 months ago)
- Language: Python
- Homepage: http://optoy.casadi.org
- Size: 1.23 MB
- Stars: 8
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
optoy
=====Because optimization is fun!
|unix| |cover| |docs|
.. |unix| image:: https://api.travis-ci.org/casadi/optoy.svg
:target: http://travis-ci.org/casadi/optoy
:alt: Build Status of the master branch on Linux
.. |docs| image:: https://readthedocs.org/projects/optoy/badge/?version=latest
:target: https://readthedocs.org/projects/optoy/?badge=latest
:alt: Documentation Status.. |cover| image:: https://coveralls.io/repos/casadi/optoy/badge.svg?branch=master
:target: https://coveralls.io/r/casadi/optoy?branch=master
:alt: Coverage StatusOptoy combines the power of `casadi `_ with a very compact Python user interface.
Start optimizing in minutes...Installation:
.. code-block:: bash
$ pip install git+git://github.com/casadi/optoy.git
Static optimization
===================.. code-block:: python
from optoy import *
x = var()
y = var()
print "cost = ", minimize((1-x)**2+100*(y-x**2)**2,[x**2+y**2<=1, x+y>=0])
print "sol = ", x.sol, y.solDynamic optimization
====================.. code-block:: python
from optoy import *
x = state()
y = state()
q = state()
u = control()
T = var(lb=0,init=10)
x.dot = (1-y**2)*x-y+u
y.dot = x
q.dot = x**2+y**2ocp(T,[u>=-1,u<=1,q.start==0,x.start==1,y.start==0,x.end==0,y.end==0],T=T,N=20)
plot(x.sol)
plot(y.sol)
plot(u.sol).. image:: https://cloud.githubusercontent.com/assets/329032/6380987/2a6fec10-bd3e-11e4-81b9-3b047d6e7066.png
Get started with some `examples `_ or by reading the `API documentation `_ .