Metadata-Version: 2.4
Name: vdx
Version: 0.0.2
Summary: Python package for index tracking in CasADi 
Author-email: "Anton E. Pozharskiy" <anton.pozharskiy@imtek.uni-freiburg.de>, Armin Nurkanovic <armin.nurkanovic@imtek.uni-freiburg.de>
Maintainer-email: "Anton E. Pozharskiy" <anton.pozharskiy@imtek.uni-freiburg.de>
License: BSD 2-Clause License
        
        Copyright (c) 2024, Anton Pozharskiy, Jonathan Frey, Moritz Diehl
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License-File: LICENCE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Dist: casadi
Requires-Dist: numpy
Requires-Dist: sortedcontainers
Requires-Dist: termcolor
Description-Content-Type: text/markdown

# `vdx`
`vdx` is the python implementation of the matlab `vdx` package.
It is built on top of the modeling and automatic differentiation tool CasADi.
It is used to keep track of indexed variables e.g. `x_i∈ Rⁿ for i in 1,...N`, as subsets of bigger vectors.
This is particularly useful for writing direct transcription optimal control problems such as those found in `nosnoc_py`.

## Installing
As this software is still in development to install the package, clone this repo and use
```bash
pip install <path to vdx>
```

## Use
The basic interface for `vdx` is the `NLP` object which contains 1 scalar objective `f` and 3 vectors `w` (the primal decision variables, `g` the constraints, and `p` problem parameters.

To start do:
```python
import casadi as ca
from vdx import NLP, Primal, Parameter, Constraint
nlp = NLP(symbolic_type=ca.SX)

nlp.w.x[range(1,11), range(1,3), range(1,3)] = Primal("x", 4, lb=0.0) # Creates x_i_j_k with i=1,...10, j=1,2, k=1,2
```