Metadata-Version: 2.3
Name: focont
Version: 1.0.1
Summary: Fixed order controller design tool
Project-URL: Homepage, https://github.com/dmrokan/focont
Project-URL: Documentation, https://github.com/dmrokan/focont/blob/main/doc/focont.md
Project-URL: Repository, https://github.com/dmrokan/focont
Project-URL: Bug Tracker, https://github.com/dmrokan/focont/issues
Project-URL: Changelog, https://github.com/dmrokan/focont/blob/main/CHANGELOG.md
Author-email: Okan Demir <okndemir@gmail.com>
Maintainer-email: Okan Demir <okndemir@gmail.com>
License: Copyright (c) 2024 Okan Demir
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
License-File: LICENSE.md
Keywords: conroller-design,control,optimal-control,static-output-feedback,systems
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: numpy
Requires-Dist: scipy
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-randomly; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-randomly; extra == 'test'
Description-Content-Type: text/markdown

# Focont

**Static output feedback and fixed order controller design package for Python**

## Static output feedback (SOF)

The SOF is the simplest feedback controller structure. It basically feedbacks
the system output to the system input after multiplying a constant gain matrix.

This package can calculate a stabilizing SOF gain which also optimizes the ![H2](/doc/h2.gif)
norm of the closed loop system.

However, this algorithm works under sufficient conditions. If the problem
parameters (listed below) is not appropriate, the algorithm fails and
prints an error message.

(See the article, https://journals.sagepub.com/doi/abs/10.1177/0142331220943071 ,
and the PhD thesis, http://hdl.handle.net/11693/54900 , for detailed
information and analysis)

The algorithm is purposedly developed for discrete time systems, but it also works
for continuous time systems when the SOF is calculated for the zero-order hold
discretized version with a sufficiently large sampling frequency.

Furthermore, the algorithm can be used to calculate fixed-order controllers.
This need additional entries in the described JSON or mat file.

Please, vizit [API docs](/doc/focont.md) for the detailed information.


## Installation

Create and activate a virtual environment (this step is not required but recommended).
Then,
```
python3 -m venv venv
source venv/bin/activate
pip install -e '.[dev]'
pytest
pip install -r requirements.txt
```
or
```
pip install numpy scipy
```
Finally,
```
pip install .
```

### Also,

It can be installed with pip from `pypi`.
```
pip install focont
```

## Example

```python
from focont import foc, system

pdata = system.load(json_or_mat_filename)
foc.solve(pdata)
foc.print_results(pdata)
```

You can find json and mat file examples in the `/tests` directory.

