Slashdot Mirror


Simple, Portable Physics Simulations

ttsiod writes "I want to 'lure' my nephews/nieces towards Science and Engineering (to whatever extent that's possible, in the age of consoles). To that end, I have coded simple physics simulations, like falling snow, exploding fireworks, and 1D/2D wave simulations. My efforts are here, in the form of portable SDL mini-programs (GPL code, compilable under Windows, Linux, Free/Net/OpenBSD, Mac OS/X and basically every OS with GCC and SDL). Try them out, and do offer any suggestions on other programs that can trigger scientific interest in young minds. Myself, I am teaching them Python, so that they can code 'fireworks' on their own."

13 of 145 comments (clear)

  1. wot? by sammyF70 · · Score: 4, Interesting

    I seriously have to ask : what does a 1-Dimensional wave look like????

    --
    "DRM is like the Ford Pinto: it's a smooth ride, right up the point at which it explodes and ruins your day."-C.Doctorow
    1. Re:wot? by FlyByPC · · Score: 5, Informative

      I seriously have to ask : what does a 1-Dimensional wave look like????

      A compression wave. Think of a sound wave traveling along a very slender rod, after a hammer hits the end.

      --
      Paleotechnologist and connoisseur of pretty shiny things.
    2. Re:wot? by History's+Coming+To · · Score: 4, Informative

      Nope, you're a dimension out (fencepost error?!).

      1D: Compression wave in a single dimension, like the "striking a rod" example above.

      2D: Guitar string. A string is a single dimension (eg left to right) but you need a second dimension for it to vibrate up and down.

      3D: Ripples in a pond. The pond surface is a plane (2D, left/right, forward/back) but the wave is a displacement in a third dimension (up/down).

      --
      Please consider this account deleted, I just can't be bothered with the spam anymore.
    3. Re:wot? by gardyloo · · Score: 5, Informative

      Actually, your parent poster is correct: a transverse wave like on a string can be parametrized by one coordinate, since the displacement isn't a dimension. So both compressional and transverse waves on a string can be said to be 1D _in_space_: give an x-coordinate, I can tell you the displacement at a given time (or, if you're masochistic, take the one spatial dimension to be the length along the string from some origin).

          2D: ripples on a pond. Need an (x,y) to specify the location; the other number is the displacement (or density, or velocity; doesn't matter).

          3D: ripples in a volume, such as sound waves in an unbounded medium, electromagnetic waves in space, etc. There are two ways to be "off" by one dimension in problems such as these:
                          1) count time as a needed dimension (usually, it's treated as a parameter, especially for time-harmonic problems, but sometimes it's really needed, as in SR and GR);
                          2) not take advantage of symmetries in the problem, which can sometimes collapse the problem to a lower dimension (or _almost_ lower dimension).

  2. FreeBASIC by FlyByPC · · Score: 3, Informative

    OK, so it doesn't have "teh s3xy" of Java, Python, or Ruby -- but BASIC is very easy to pick up, and with modern dialects like FreeBASIC, you can write good, modular, maintainable programs. It's also a lot of fun, which seems to be especially important; you can write a quick simulation of whatever you're interested in, without a lot of work.

    This isn't your father's BASIC; it has support for lots of memory, 32-bit graphics, user data types, functions and subroutines (including passing by reference or value), and even multithreading including mutexes. Or you could use it to run older QBasic programs from the Dark Ages, complete with line numbers, LET statements, GOTOs, and all that.

    Pick up FBIDE while you're there, too.

    ...Oh, and did I mention that both FreeBASIC and FBIDE are free?

    --
    Paleotechnologist and connoisseur of pretty shiny things.
    1. Re:FreeBASIC by K.+S.+Kyosuke · · Score: 4, Insightful

      In order to save children from the hell called Basic, Seymour Papert created a nice language called Logo.

      --
      Ezekiel 23:20
  3. Physics Simulators by brycef · · Score: 5, Informative

    It is not programming, but Phun is a good 2-D physics simulator for kids.

    Another that takes a bit more work is Google's Sketchup with the SketchyPhysics plugin.

  4. Paul Falstad Applets by Wookie+Monster · · Score: 5, Informative

    A much larger and cooler collection of physics applets can be found at http://www.falstad.com/mathphysics.html

  5. Just buy some... by oh2 · · Score: 4, Insightful

    ...real fireworks for them instead. The real thing beats just about everything and eyebrows grow back, you know. :)

    --

    Now the world has gone to bed, Darkness won't engulf my head, I can see by infra-red, How I hate the night.

  6. The kids might enjoy VPython by magneticstorm · · Score: 5, Informative

    Since you have a strong interest in visualizations of physics phenomena, and you're already teaching your nieces and nephews how to write Python, I'd like to suggest that you check out VPython, which is a series of 3D extensions to Python. In particular I think you'll be intrigued by these examples which visualize everything from wave superposition, to magnetic fields, to concepts from relativity. For immediate gratification, the author of that examples page also has Wiimote integration, so you can bridge interest that your relatives might have in video games into an interactive experience in your physics environment.

    Good luck!

  7. Good work, but... by Mike+Rice · · Score: 5, Interesting

    Simulations that are useful for learning must be grounded in reality. They must give the learner a chance to extrapolate principles from their own personal hands-on observations to the simulation.

    Without original personal observation of physical phenonema, simulations are little more than 'das blinken lights' to the learner.

    Don't get me wrong, the stuff offered by the OP is good. And if the kids in question already have an interest in the subject, its great.

    But to spark an original interest takes hands-on, thought provoking experiments that the learner may manipulate in any way they wish (some of which you probably never thought of).

    Example. Electromagnetism. My 8th grade grandson (yup I'm an old geezer who cut my teeth on vacuum toobs and RTL) learned a lot about the interplay between electric and magnetics fields just today. I suspended a magnet on a string, over an aluminum plate, and just left it there for him to find, and play around with. After he had done so, he asked why when the plate was present the pendulum swiftly assumed a stable position, whereas when the plate was absent the pendulum assumed a rather chaotic motion... even though the magnet was obviously not attracted to aluminum.

    After explaining it to him and allowing him to further explore the physics with magnet wire and batteries, he came away with a firmer grasp on electromagnetism, a grasp I highly doubt he would have gotten from a canned simulation. Now that he has made a connection in his mind between the seen (magnetic damping of the pendulum motion) and the unseen (electrical currents in the aluminum plate, and the ensuing magnetic field), a simulation would allow him to further explore the subject without requiring expensive laboratory equipment.

      So, Kudos for the work, but you have to get out there and actively, physically engage them with hands-on experiments. After, that is really what science is about!

  8. Computer simulations?!? by Anonymous Coward · · Score: 5, Insightful

    No, no, no.

    To get kids interested in Physics - or anyone for that matter, a physical real world demonstration is the way to go. The most popular physics professor at MIT is known for his lecture theatrics.

    Shooting metal balls across the room and having them derive an equation will teach them something.

    Computer simualtions are boring! It's worse than watching TV and they will learn nothing. No. Have them create experiments, duplicate classic ones - some of the classic E&M experiments are a hoot and they're easy to build and best of all, they're not a computer simulation. They are REAL LIFE.

  9. Physics 2000 by StarDrifter · · Score: 3, Informative

    The University of Colorado has something called Physics 2000 that has a bunch of applets. Click on "Applet Thumbnails" in the top-left frame. One of my favorites is "Satellite orbits" (click on "Upcoming Applets"). You can try to find stable orbits around the Earth. You can try to find stable orbits around the Moon (although I don't think there are any). You can try launching some objects clockwise and some counter-clockwise and see if it is easier to get things in a stable orbit one way or the other. You can launch a bunch of objects in random directions with random velocities and watch most of them die an early death and a few stick around much longer. Sometimes you can see Orbital resonance. The simulation extends beyond the visible portion of the screen so you can even get objects in orbits with very long periods that are only visible for a very short portion of their orbit as they dip close to the Earth and then sail away again.