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."
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
Looking at the summary as well as at the webpage it does not become clear how old the mentioned kids are and if the goal is really understanding science and engineering. For a younger age things like http://www.crazymachinesgame.com/ which give a more playful introduction to physics might be better. Programming for kids has been addressed multiple times on Slashdot.
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.
...Oh, and did I mention that both FreeBASIC and FBIDE are free?
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.
Paleotechnologist and connoisseur of pretty shiny things.
When I was attending Syracuse U. in the early nineties, a cool elective class came up for us physics nerds attempting to align with the dawn of computer programing en masse. For a nerd like myself, this was absolutely appealing. It included small programs simulating exactly what you note, and beyond.
I would say your efforts need to include the real world though - getting kids excited about mapping physics and mathematical colloquialisms on a computer also needs to have roots in the physically applicable world. It was this connection that kept me, and keeps me, interested in natural sciences and mathematics to this day.
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.
That's a nice thing to do for your kids. If you want to show them more such programs, or draw inspiration, I recommend this collection of Java applets.
Phun has already been suggested and it's good. another good game is garry's mod. http://www.youtube.com/watch?v=Ae6ovaDBiDE with the two addons (PHX and wire that 90%+ people have) its possible to program inside the game. check out wiremod.com/forums to see what's possible.
A much larger and cooler collection of physics applets can be found at http://www.falstad.com/mathphysics.html
You might want to take a look at NetLogo (http://ccl.northwestern.edu/netlogo/). To quote the documentation: "NetLogo ... comes with a Models Library, which is a large collection of pre-written simulations that can be used and modified. These simulations address many content areas in the natural and social sciences, including biology and medicine, physics and chemistry, mathematics and computer science, and economics and social psychology."
The models demonstrate some nice concepts and are easy to modify and a great source of material on how to implement your own models (see http://ccl.northwestern.edu/netlogo/models/ and scroll down a bit for the list).
Phun is great too...
Make a simple game that involves particle physics. Wave physics is a bit too complicated, unless your nephews are in later classes of high school. I would suggest something like Scorched Earth.
This is great to see, very easy to compile and to play around with. During a little extra time about 5 years ago I explored particle simulations with forces similar to electrostatic and atomic forces. Also had fun doing some stuff with artificial life. That was all on Windows NT and used OpenGL but I wrote my own library in C++ so I'll have to hook that library up with this code and re-release some of those toys under the GPLv3. ForceMaster was what I called it back in the day.
...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.
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!
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!
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.
For those who wish additional simulation, check out The PhET Simulations.
"She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
A shameless plug this - something a bit odd I created over 10 years on the Amiga and spruced up recently. Worth looking at if you like a mix of physics with tons of particles, and weird Jeff Minter/psychedelia stuff:
http://www.youtube.com/watch?v=LTW09McfCjA
"Chaotic Bouncefloor of Doom"
Love to port over the program to the PC sometime...
Why OpalCalc is the best Windows calc
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.
This is one of my personal favourites for simulating physics experiments, God knows how many times it was useful in proving my teachers wrong ^.^
It is very much like a virtual lab. Yenka / Crocodile Clips has a version for other branches of science too. Free home use licenses.
Downside: it's not open source.
Life is too good to waste... Read!
I'd be interested to hear how teaching python to kids is going, what age is a fair age to start?
Throwing in a shameless plug for a game I worked on - Powder Toy ( http://powder.unaligned.org/ ) - it may not be physically accurate (at all) but it's a lot of fun and would introduce them to pressure and velocity in a fun way.
I want to 'lure' my nephews/nieces
I'm glad the rest of that sentence ended up better than it started out.
I really hate when politics is used to endanger education.
What if a better package is available that is not GPL? They do not get a science/physics backing from you? What is more important?
Newton physics engine has now python bindings maintained by users, and is availible on linux, windows, mac etc.. platforms.
Python especially with scipy libraries works extremely well in science, and mplotlib is an excellent and extremely simple to use plotting framework.
Python seems to be pretty much becoming the standard language in science (at least in physics, is it, I'm a physics PhD student). Almost all new stuff is written in f90 or c++ and tied together with Python, and as a stand alone language, Python is slowly replacing Matlab (thank the gods).
My 10 year old showed this to me : http://dan-ball.jp/en/javagame/dust It is not exactly physically accurate, but it is really pretty cool and fun, and much more accurate than I expected.
And can I say fast for what I thought one could get from Java.
As opposed to PROGRAMMING
Get them some building kit like mindstorms. This kid created a mock-car factory using mindstorms. Just search youtube for lots of similar examples.
Or kits to build steam and stirling engines.
Hands-on experience.
Isn't that what the Demoscene was doing back in the later-BBS days?
THL phish sticks
I really get the sense that you're trying to reinvent the wheel here. If you talk to a decent physics teacher, they could probably point you to a lot of existing tools (and programming toolkits) that do what you want. I've set up several similar math and science environments for various classrooms. And I've certainly never had to write a line of code to do it.
Are you doing this for pedagogical value or as an excuse to write code that someone besides yourself will use? That's the real question you need to be asking.
Support microSD: in a post 9/11 world, it is unwise to carry your data on media that you cannot comfortably swallow.
Mobinet is an open-source platform for mobile objects programming (simulation, games, graphics, maths-physics, ...). It is developed by INRIA Grenoble in France and used to initiate students (from high school to university) to games programming, or more generally to provide them with a concrete intuitive and fun version of the notions seen in math and physics course.
You might enjoy this Kinetic Model of elastic collisions.
Similar physics sims in GameMaker at http://rupert.id.au/schoolgamemaker/samples3/
The University of Colorado also has something called PhET which is a different collection of applets for physics, biology, chem, earth science and math. The physics goes up to basic quantum.
Thank you sir. I think my kids will enjoy this, and if not, then it sounds like there's plenty of other stuff out there that might pique their interest, or at least mine. Special shout-out to the dude who posted the link to FreeBasic.
... at the top of the page http://flexcomm.com/.
now we need to go OSS in diesel cars
de Laval nozzles are cool.
Seastead this.
http://www.falstad.com/mathphysics.html
"Time is nothing; timing is everything."
Want your kids to learn physics? Throw away the computer simulations. Build things with them. Run experiments. Observe and think about the results.
To teach physics, start with things like C-clamps, string, rubber bands, wire, springs, low-friction carts, compasses, magnets, thermometers, balloons, weights, scales, and pulleys.
More advanced stuff: a voltmeter/ammeter (analog stuff), an old oscilloscope, an air table (a kids' hockey table), vacuum pump & bell jar, countdown timer/photogate, etc. Many of these things show up on craigslist for cheap (I picked up two free oscilloscopes and have given them to my sharp high school students).
Computer simulations? Naw. Have your kids do real physics:
A pendulum made of a bowling ball and rope. Time the pendulum swings and then ask: which will change the period - changing the lenghth of the swings, changing the weight, or changing the length of the rope?
Fool around with a signal generator, an oscilloscope, and a microphone. What's a sound wave look like? How is frequency related to period?
Play with thermometers, ice, water, and fire. What's the temperature of ice and water? Can you get water colder than this? How hot is water from the kettle? Can you get water hotter than this?
Get a voltmeter, wire, and some magnets. Can you really induce a voltage by moving a magnet nearby?
Don't sidetrack your kids with simulations & computer graphics. Real physics starts by fooling around with reality.
Obs Feynman quote: "It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
It's still 2 dimensional.
I got my children at the age of 7,8 to watch how salt prevents oxidization of cut apples, thin copper plate and wire attached to the lemon to show how electricity is generated, a crd board box with my maginfying glass, a slide and flash light to display image on a screen - optics , etc. etc. picked up discarded remote car and joy sticks, removed them, attached plane propeller (from old toy), glued empty soda cans(all wax sealed , and mounted the remove car parts on the soda can platform and made a remote controlled barge and so on. Both of them are electrical and Aero engineers now. You need to make children curious and explain to them through very elementary experiments to learn things. Make them to participate in science fair. Take them often to science museum . Best of luck.
World of Goo.
Actually pretty damn good for adults too :-)
http://www.abandonia.com/en/games/25/Incredible+Machine,+The.html
Ok, maybe not /the/ most physically realistic.... but definitely the most fun!
I'm surprised that no-one has posted a link to Easy Java Siimulations yet. This allows you to get your hands on the equations more.
Languages aren't inherently fast -- implementations are efficient
Did anyone suggest Processing yet? http://processing.org/ Java-based, but much easier to get into (has its own editor) - and the site above includes loads of physics / trig etc examples. A great combination for learning programming, maths and physics.
For those who don't get the parent's joke Logo is often considered to be derived from LISP.
Maybe off subject but I had a great weekend of gaming playing Trials HD on the Xbox 360. Think Kickstart II on the C64 from years ago but add in lovely graphics and an amazing physics based environment. A sublime example of demonstrating objects in a videogame with physical world properties. It's also an easy to pick up, fun and addictive game to boot.
Trials HD review: http://www.youtube.com/watch?v=pyE_j_GSsXQ/
I don't know, maybe the 'level editor' in this game would answer the OP's question?
The tip of my erect penis stands 0.8m above the floor. If I launch a 5 gram wad of semen into the air at a velocity of 2m/s and an angle of 38 degrees above the horizontal, how far away does your mother have to be to catch it in her mouth which is 0.65m above the floor?
The wave simulation is very nicely executed. It does also seem to generate some rather interesting artefacts. If you move the mouse to to very close to a corner and hold it down for a second or so and release. The smaller high frequency wave will interfere to produce a much lower frequency wave with one or two point peaks. This peeks then drift across the screen. I've also managed to produce a standing wave as well. Quite an interesting phenomena but I'm not sure if its really accurate or an artifact of the way the program is coded.
There are four sorts of people in the world: fools, lunatics, idiots and morons. - Umberto Eco, Foucaut's pendulum.
Tim or The Incredible Machine has to be one of the best games ever for getting kids into science. I know, it worked on me and was one of the big turning points in my life. It has all the thing you may want to inspire from changing gravity to combining different colour lights. it is the best sci game out there that i know of that doesnt end up boring the student.
http://www.dosgamesonline.com/index/game/381/The_Incredible_Machine.html
really try it out it even made my sister slightly nerdy.
Flash is underpowered of course for serious stuff. But for portable, simple physics simulations flash is viable. example:
http://box2dflash.sourceforge.net/