From 61392e7fa058a052530d1200f9dc666a80928efe Mon Sep 17 00:00:00 2001 From: pulipakaa24 Date: Sat, 22 Nov 2025 22:35:04 -0600 Subject: [PATCH] added readme and requirements for simulator --- MAGLEV_DIGITALTWIN_PYTHON/ReadMe.md | 7 +++++++ MAGLEV_DIGITALTWIN_PYTHON/requirements.txt | 12 ++++++++++++ MAGLEV_DIGITALTWIN_PYTHON/topSimulate.py | 1 - MAGLEV_DIGITALTWIN_PYTHON/visualize.py | 1 - 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 MAGLEV_DIGITALTWIN_PYTHON/ReadMe.md create mode 100644 MAGLEV_DIGITALTWIN_PYTHON/requirements.txt diff --git a/MAGLEV_DIGITALTWIN_PYTHON/ReadMe.md b/MAGLEV_DIGITALTWIN_PYTHON/ReadMe.md new file mode 100644 index 0000000..f736c46 --- /dev/null +++ b/MAGLEV_DIGITALTWIN_PYTHON/ReadMe.md @@ -0,0 +1,7 @@ +# How To Use +## Running the Simulation +Run ```pip install -r requirements.txt``` followed by ```python topSimulate.py```. Or, if your environment is already set up, just run the python file. +## Modifying the PID control algorithm +Modify ```controller.py```. You will see constants related to heave, pitch, and roll controllers. Will update to include current control and will make simulation much more accurate soon. +## Modifying pod parameters +```parameters.py``` provides all necessary mechanical parameters. Yoke and sensor locations are matrices formed by putting together 4 column vectors of the form $\begin{bmatrix}x\\y\\z\end{bmatrix}$ relative to the center of mass.

```fmag2()``` within ```utils.py``` deals with the magnetic parameters. diff --git a/MAGLEV_DIGITALTWIN_PYTHON/requirements.txt b/MAGLEV_DIGITALTWIN_PYTHON/requirements.txt new file mode 100644 index 0000000..d715e50 --- /dev/null +++ b/MAGLEV_DIGITALTWIN_PYTHON/requirements.txt @@ -0,0 +1,12 @@ +contourpy==1.3.3 +cycler==0.12.1 +fonttools==4.60.1 +kiwisolver==1.4.9 +matplotlib==3.10.7 +numpy==2.3.5 +packaging==25.0 +pillow==12.0.0 +pyparsing==3.2.5 +python-dateutil==2.9.0.post0 +scipy==1.16.3 +six==1.17.0 diff --git a/MAGLEV_DIGITALTWIN_PYTHON/topSimulate.py b/MAGLEV_DIGITALTWIN_PYTHON/topSimulate.py index 0a0b3f4..caaff94 100644 --- a/MAGLEV_DIGITALTWIN_PYTHON/topSimulate.py +++ b/MAGLEV_DIGITALTWIN_PYTHON/topSimulate.py @@ -5,7 +5,6 @@ Ported from topSimulate.m to Python import numpy as np import matplotlib.pyplot as plt -from matplotlib.animation import FuncAnimation, PillowWriter from parameters import QuadParams, Constants from utils import euler2dcm, fmag2 from simulate import simulate_maglev_control diff --git a/MAGLEV_DIGITALTWIN_PYTHON/visualize.py b/MAGLEV_DIGITALTWIN_PYTHON/visualize.py index 7123c5c..dbc537c 100644 --- a/MAGLEV_DIGITALTWIN_PYTHON/visualize.py +++ b/MAGLEV_DIGITALTWIN_PYTHON/visualize.py @@ -5,7 +5,6 @@ Ported from visualizeQuad.m import numpy as np import matplotlib.pyplot as plt -from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Poly3DCollection from matplotlib.animation import FuncAnimation, PillowWriter from scipy.interpolate import interp1d