Enable easier organization of variables and constraints for Scipy Optimize
Project description
scipy-optimstruct
scipy-optimstruct is a Python package that simplifies the implementation of variables and constraints for optimization problems using the SciPy optimization module. It provides a convenient way to define and manage problem structures, making it easier to solve optimization problems.
Features
-
Introduction to Optimization Problem Structures: The package includes a Jupyter notebook that provides an introduction to optimization problem structures and demonstrates how to use the SciPy optimization module to solve optimization problems.
-
Examples of Optimization Problem Structures: The package provides examples of optimization problem structures, including linear programming, quadratic programming, and nonlinear programming.
-
Sample Code: The package includes sample code that demonstrates how to use the optimization problem structures to solve practical problems.
-
Requirements: The package includes a requirements.txt file that lists the required Python packages to run the example code.
Usage
To use scipy-optimstruct, follow these steps:
-
Install the package using pip:
pip install scipy-optimstruct
Make sure you have the required Python packages installed. You can find the complete list in the requirements.txt file included with the package.
### Sample
import numpy as np
from optimstruct.optim_dict import optim_dict
#initialize optim_dict
my_vars = optim_dict()
#add variables
foo1 = np.array([[1,2,3], [2,4,5], [3,5,7]])
my_vars.add_var("foo1", foo1)
foo2 = np.array([[1,12,3], [2,1,5], [3,55,7]])
my_vars.add_var("foo2", foo2)
#flatten variables into np.array ready to be used with Scipy minimize function
x = my_vars.toVector()
#return np.array into easily accessible dictionary in constrains
var_dict = my_vars.toDict(x)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scipy_optimstruct-0.1.3.tar.gz.
File metadata
- Download URL: scipy_optimstruct-0.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d68e194cdb0c2453133d52064b65f213a183d816c43c1bfa2aee8f1d81bea19
|
|
| MD5 |
30af5a66dacad1b697718790221d8178
|
|
| BLAKE2b-256 |
629e5b38c38c64dff4d035d3e480dd0b08562add204181f2d410a4e56f70e278
|
File details
Details for the file scipy_optimstruct-0.1.3-py3-none-any.whl.
File metadata
- Download URL: scipy_optimstruct-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aa5ef92c865446afe4330385ac938f22d89af2ef9fa5fa2940dcda530b0de55
|
|
| MD5 |
52783154b8c2b93ad2e681f5f4a83cb4
|
|
| BLAKE2b-256 |
26679e4b8de547ea7e5c3f6bc188b9137943fadbcbcee3ba245285d5166895d3
|