A furuta pendulum plotter based on matplotlib.
Project description
A plot utility for a furuta pendulum based on matplotlib.
Usage
Plots are best constructed using the FurutaPlotter wrapper class. Here is an example of how to plot a 3D animation of the pendulum and arm swinging at a constant rate for 10 seconds:
import matplotlib.pyplot as plt
import numpy as np
from furuta_plot import FurutaPlotter
FPS = 30
TOTAL_FRAMES = FPS * 10
fig = plt.figure()
p = FurutaPlotter(fig)
p.add_3D()
# One data point for each frame
phis = [2 * np.pi * i / (2*FPS) for i in range(TOTAL_FRAMES)]
thetas = [2 * np.pi * i / (FPS) for i in range(TOTAL_FRAMES)]
p.animate(fps=FPS, phi=phis, theta=thetas)
See the examples/ directory in the git repository for more usage examples.
Running Locally
If matplotlib and numpy are installed, then you can run one of the examples directly by putting the PYTHONPATH variable in front:
PYTHONPATH=. python3 examples/animated.py
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
furuta_plot-0.0.3.tar.gz
(7.3 kB
view details)
File details
Details for the file furuta_plot-0.0.3.tar.gz
.
File metadata
- Download URL: furuta_plot-0.0.3.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82da7af242b5a84cc9535cf4165bf9b83701a1891196057ed15334360102bbc |
|
MD5 | 9035ac769cc16b9c3e3c2505e5201dba |
|
BLAKE2b-256 | 6966e75d4e8b1e0815d2471269052c360bd86de3f4486e095925c819eaeff3e0 |