A package intended to build and optimize planar linkages
Project description
pylinkage
A linkage builder written in Python. This package is made to create planar linkages and optimize them kinematically thanks to Particle Swarm Optimization. It is still an early work, so it should receive great changes in the future.
Usage
As of today, the code is segmented in three parts:
- geometry.py that module handles geometric primitives, such as circle intersections, distance claculation. It works in Euclidian space only. Aside from
dist
andsqr_dist
functions, you might not use it directly. - linkage.py this module describes joints and linkages
- Due to the geometric approach, joints (instances of
Joint
object) are defined without links. - The
Linkage
class that will make your code shorter.
- Due to the geometric approach, joints (instances of
- optimizer.py proposes three optimizations based on three techniques:
- The "exhaustive" optimization (
exhaustive_optimization
function) is a dumb optimization method, consisting or trying sequencially all positions. It is here for demonstration purposes only, and you should not use it if you are looking for an efficient technique. - The built-in Particle Swarm Optimizer (PSO). I started with it, so it offers a large set of useful options for linkage optimization. However, it is here for legacy purposes, and is much short than the PySwarms module.
- PSO using PySwarms. We provide a wrapper function to PySwarm from ljvmiranda921, that will progressively be extended.
- The "exhaustive" optimization (
Requirements
Python 3, numpy for calculation, matplotlib for drawing, and standard libraries. If you do not want to use PySwarms feel free to use the built-in PSO.
Usage
Documentation coming soon.
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
pylinkage-0.2.0.tar.gz
(17.9 kB
view details)
File details
Details for the file pylinkage-0.2.0.tar.gz
.
File metadata
- Download URL: pylinkage-0.2.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 298812c1f62cc0480386c824aa50ae744180fc5ff65d3575eebc552d6c8eeb7a |
|
MD5 | 61e6861c907a29bde71e88401cb36181 |
|
BLAKE2b-256 | 28b2f84cb357b42b5775ea2352cb74ce472ff249ec53fd55dc2ac72e6ca7664f |