Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no idea for a simulation
#1
Hello

I'd like to code the following simulation :
https://www.youtube.com/watch?v=cAPmX_BdYK0

I have no idea how to do so

More broadly, do you know any tip to model a magnetic field on python?

Thanks for your help
Reply
#2
To "model" things like that you really just need to know all the math. If you do, python modules like numpy, scipy, pandas, etc. will assist you in the coding aspects. Best way to get them is to just use a Python/Anaconda distribution.

If you need (or want) to see your model visually the check out Vpython.
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter
Reply
#3
I think the setting in the simulation should be water float the box up and the spring pull the box down so up and down that is what are you watching in the video
Reply
#4
As a physicist, "simulation" to me means solving some set of equations (e.g. the equations of magnetohydrodynamics) from some initial state (i.e. the values of the various quantities - density, magnetic field, velocity, ...) at t = 0 for subsequent times. If you're interested in that kind of thing, you need to familiarise yourself with the issues of numerical analysis. The book Numerical Recipes is one place to get the details (though I don't know if they have a Python version these days) of how you (say) solve differential equations numerically.
Reply
#5
(Jan-15-2020, 07:09 PM)Marbelous Wrote: To "model" things like that you really just need to know all the math. If you do, python modules like numpy, scipy, pandas, etc. will assist you in the coding aspects. Best way to get them is to just use a Python/Anaconda distribution.

If you need (or want) to see your model visually the check out Vpython.

Thanks for your help !
I didn't t know about Vpython. Can you model effectively everything you want?
Reply
#6
You can model using virtually any programming language, even Basic. Key is that Python has the structure and the libraries to make it easier. A model usually is created to answer questions about expected behavior. So, you need to know the equations that govern your model and the questions you will ask of it.
Reply
#7
(Jan-19-2020, 01:39 PM)jefsummers Wrote: You can model using virtually any programming language, even Basic. Key is that Python has the structure and the libraries to make it easier. A model usually is created to answer questions about expected behavior. So, you need to know the equations that govern your model and the questions you will ask of it.

What are the pythons module/libraries that allow such graphical modelling?
Reply
#8
See note by Marbelous above
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with simulation Geeseball 0 2,044 Oct-18-2018, 12:19 PM
Last Post: Geeseball

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020