Python script for generating slider-crank kinematic diagrams and graphical position-analysis plots for the kinematics project report.
This repository supports the graphical position analysis portion of a slider-crank linkage project. The script generates plotted mechanism configurations for selected crank angles so the figures can be included in the final report.
The script:
- computes slider-crank geometry from linkage parameters
- solves for connecting rod angle
θ₃and slider displacementd - plots the mechanism configuration for selected crank angles
- generates figures for both the open and crossed branches
- saves the plots as
.pngfiles for use in the report
The script is currently configured with:
a = 16.0 inb = 118.0 inc = 0.0 in
Selected crank angles:
θ₂ = 35°θ₂ = 90°θ₂ = 245°
- Python 3
- Matplotlib
Install Matplotlib with:
pip install matplotlib
Run the script from the project directory:
python3 plot.py
The script creates a folder named slider_crank_plots and saves the generated figures there.
Expected output files:
theta2_35_open.pngtheta2_35_crossed.pngtheta2_90_open.pngtheta2_90_crossed.pngtheta2_245_open.pngtheta2_245_crossed.png