[SciPy-User] Multibody Vehicle Dynamic Simulation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[SciPy-User] Multibody Vehicle Dynamic Simulation

KartDynamics

Dear Scipy-Users,

 

I am a student from Germany and I'm new to Scipy.

It would be nice if you could help me out with your recommendations for the following project:

 

I am planing to do a vehicle dynamic simulation with a multibody system for a race car. The suspension of the car is very simple and the whole car can be simplified.

 

Goal:

The vehicle should automatically follow a given path/trajectory (which is the racing line of a racing track) at the maximum possible speed/acceleration.

I want to optimize some suspension parameters to get the minimum lap time of the given path/trajectory. This is called a lap time simulation.

It should be possible to visualize the car in a (simple) 3D Model.

 

The conditions for this project:

I have time of 5 months for this project. I am a bachelor student of automotive engineering. I am working full time on this project. I am willing to do programming. I have some basic experiences in python and i have installed the anaconda distribution on a Linux distribution. I have basic knowledge of kinematics/dynamics.

 

Some doubts and questions that i have:

1. In general: is it possible and advisable to do this in python? If not, which free software would you recommend? MBDyn? GNU Octave? SciLab? OpenModellica? MBSymba?

2. Which python environment (for Linux) would you recommend for programming? Spyder? Jupyter Notebook?

3. Which software would you recommend for visualization?

4. Which package should I use for the multibody approach? PyDy? SymPy?

5. How should I model the tires? With OpenTyre?

6. Which book is recommendable for my project? "The Multibody Systems Approach to Vehicle Dynamics" by Mike Blundell? Do you know any other source of information which could be helpful for me?

7. Do you think I can handle this project in the given time?

 

Thanks a lot!

Greetings

 


_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Multibody Vehicle Dynamic Simulation

Mark Alexander Mikofski
Hi and thanks for your interest in SciPy and Python. My responses corresponded to your number questions:

  1. In my humble opinion Python with NumPy (http://www.numpy.org/) is especially well suited to your problem (of the multibody vehicle dynamic simulation), although other tools would also serve you well:
    • MATLAB (by the Mathworks) although expensive, and costly for additional toolboxes is sometimes sold at a reduced price, or offered free, to colleges, so you should check if this is already available. It has a just in time compiler, extensive documentation, and online support
    • Python is FREE, almost all of the useful additional packages are also FREE (such as NumPy, SciPy, Numba, Cython), it also has a JIT compiler (Numba), although most documentation is extensive, it isn't consistent for every package since there are different developers usually volunteering, however online support for Python and Python packages (such as this forum) is in my opinion just as good or better than MATLAB. Typically you will find most answers either on StackOverflow, in a user forum or IRC/Slack channel, or on GitHub, however it is important to remember to be patient and respectful of others time, since they are not paid to respond to your questions or issues. You can also pay for online Python support from Anaconda (https://www.anaconda.com/support/) and Enthought (https://www.enthought.com/)
    • I think you will have a hard time with Octave or SciLab, not sure about the rest.
    • Julia (https://julialang.org/) is a new scientific computing language that you might consider, although IMHO, Python will be an easier path b/c it is more mature, more widely used, more support, and more packages.
  2.  I think you should use Spyder for developing modules and packages that form a reusable project. And then you can write scripts and reports with graphics, text, and equations in Jupyter notebooks so you can share them with others
    • For example: you could develop a package in Spyder called racetrack that contains classes like car, track, and all of your physics like forces with centrifugal, gravity, and friction. Then in a Jupyter notebook you could import racetrack and use it to simulate a race car and optimize its speed and steering to minimize its time around the track. You can demonstrate the equations and display plots and images in the notebook, export it as HTML or pdf and share it with others.
    • Make sure you keep everything in a Git repository, then mirror your repo online. I personally like GitHub, but Bitbucket and GitLab are also fine.
  3. Depends on what type of visualization. For plots and charts, matplotlib and seaborn are good, Bokeh is great for interactive plots, altair and holoview and good for descriptive (vs. imperative) datavis, this is a new concept where you let the software decide the best way to represent your data, rather than make commands about ever property of the plot.
    • for 3-d car simulations, I think you would have to try something like sketchup (https://www.sketchup.com/) which uses Ruby I think
  4. It appears to me that PyDy actually uses SymPy already for algebraic manipulation, so in using PyDy you would also be using SymPy.
    • looking at the PyDy site it hasn't been developed in over 2 years, that doesn't mean that it isn't any good, but it may mean that you may have difficulty getting support.
    • perhaps you can consider this as an opportunity to revive PyDy and make some contributions to improve it or bring it up to date?
    • fork PyDy on GitHub https://github.com/pydy, create a conda environment without PyDy installed, and do a developer/editable install (pip install -e or python setup.py develop see https://pip.pypa.io/en/stable/reference/pip_install/ or http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode), you can install the official version in a fresh conda environment either from PyPI (https://pypi.org/project/pydy/) using pip or from conda-forge (https://conda-forge.org/feedstocks/) using conda -c conda-forge ...
    • If you were to choose SymPy, which is only for algebraic manipulation, then you would have to develop all of the dynamic equations from scratch, which has already been done in PyDy, so you might be duplicating work already done, and your efforts might be better used improving what already exists?
  5. 5-6 I think you're going to have to figure these out on your own, maybe someone else will have some opinions. Try Stack Exchange? I know that some racing teams are already using Python to analyze their cars, so if you keep searching I bet you will come across them. Maybe go to some car races and ask in the pit?
Good luck and happy coding!


On Fri, May 25, 2018 at 1:27 AM, <[hidden email]> wrote:

Dear Scipy-Users,

 

I am a student from Germany and I'm new to Scipy.

It would be nice if you could help me out with your recommendations for the following project:

 

I am planing to do a vehicle dynamic simulation with a multibody system for a race car. The suspension of the car is very simple and the whole car can be simplified.

 

Goal:

The vehicle should automatically follow a given path/trajectory (which is the racing line of a racing track) at the maximum possible speed/acceleration.

I want to optimize some suspension parameters to get the minimum lap time of the given path/trajectory. This is called a lap time simulation.

It should be possible to visualize the car in a (simple) 3D Model.

 

The conditions for this project:

I have time of 5 months for this project. I am a bachelor student of automotive engineering. I am working full time on this project. I am willing to do programming. I have some basic experiences in python and i have installed the anaconda distribution on a Linux distribution. I have basic knowledge of kinematics/dynamics.

 

Some doubts and questions that i have:

1. In general: is it possible and advisable to do this in python? If not, which free software would you recommend? MBDyn? GNU Octave? SciLab? OpenModellica? MBSymba?

2. Which python environment (for Linux) would you recommend for programming? Spyder? Jupyter Notebook?

3. Which software would you recommend for visualization?

4. Which package should I use for the multibody approach? PyDy? SymPy?

5. How should I model the tires? With OpenTyre?

6. Which book is recommendable for my project? "The Multibody Systems Approach to Vehicle Dynamics" by Mike Blundell? Do you know any other source of information which could be helpful for me?

7. Do you think I can handle this project in the given time?

 

Thanks a lot!

Greetings

 


_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user




--
Mark Mikofski, PhD (2005)
Fiat Lux

_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: Multibody Vehicle Dynamic Simulation

The Messie
In reply to this post by KartDynamics
Hello,

1. 3. and 4. You can use Panda3D for the simulation which comes bundled with its flavor of pyODE (Open Dynamic Engine) and adequate documentation to be useable. Additionally, you can visualize your car very easily using its rendering process. More on https://www.panda3d.org/
PyDy and SymPy in my opinion are not suitable for such complicated tasks, but again it depends on how detailed you want your model to be, maybe you can work something out if you simplify your model to 2 dimensions only (ignore pitch, roll etc.).

Far easier would be to use TORCS which is inherently thought to be used for such purposes, or its evolution a.k.a. Speed Dreams. The model used for the simulation is not a dynamics simulation but rather simply calculating the equations of motion, but it is also capable for calculating advanced movements of the tires and body. 

2. Personally I use linux with Spyder but other solutions work equally well.

5. Tire modeling: Use the Pajecka function for fitting your data (if you have some). SciPy should be more than adequate for that. However you have to figure out how to import the equations in the dynamics engine, usually contact physics of tyres are too advanced for any dynamics package to handle. E.g. ODE has simply a static and a dynamic friction coefficient, which is mostly enough for normal purposes, but for racing simulation may be inadequate.

6. The book you mention is quite good. Tyre vehicle dynamics by Pacejka is also good for knowledge on the tyres (after all most of the work on the car is done to make sure that can transfer the power to the road through the tires). However there is no book to my knowledge that provides the full set of equations of motion of a vehicle.

7. ?? it's up to you I guess. Not an easy task for sure.


Regards,
Thanass depending on the feats you wish to havis


On Fri, May 25, 2018 at 10:27 AM, <[hidden email]> wrote:

Dear Scipy-Users,

 

I am a student from Germany and I'm new to Scipy.

It would be nice if you could help me out with your recommendations for the following project:

 

I am planing to do a vehicle dynamic simulation with a multibody system for a race car. The suspension of the car is very simple and the whole car can be simplified.

 

Goal:

The vehicle should automatically follow a given path/trajectory (which is the racing line of a racing track) at the maximum possible speed/acceleration.

I want to optimize some suspension parameters to get the minimum lap time of the given path/trajectory. This is called a lap time simulation.

It should be possible to visualize the car in a (simple) 3D Model.

 

The conditions for this project:

I have time of 5 months for this project. I am a bachelor student of automotive engineering. I am working full time on this project. I am willing to do programming. I have some basic experiences in python and i have installed the anaconda distribution on a Linux distribution. I have basic knowledge of kinematics/dynamics.

 

Some doubts and questions that i have:

1. In general: is it possible and advisable to do this in python? If not, which free software would you recommend? MBDyn? GNU Octave? SciLab? OpenModellica? MBSymba?

2. Which python environment (for Linux) would you recommend for programming? Spyder? Jupyter Notebook?

3. Which software would you recommend for visualization?

4. Which package should I use for the multibody approach? PyDy? SymPy?

5. How should I model the tires? With OpenTyre?

6. Which book is recommendable for my project? "The Multibody Systems Approach to Vehicle Dynamics" by Mike Blundell? Do you know any other source of information which could be helpful for me?

7. Do you think I can handle this project in the given time?

 

Thanks a lot!

Greetings

 


_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/scipy-user