Monday, July 14, 2014

Standing Waves/Resonance Applet

The second applet that I wanted to rewrite to save it from Java purgatory was a great transverse standing wave applet by C.K. Ng. I used this principally for a data source for students to explore resonance - it's a lot easier to get reliable data with sufficient amplitude variation using an applet for this than a real experiment. In addition to the standing wave amplitude never being overwhelmingly large with a string vibrator, there are hysteresis effects that will drive the kids crazy. I have them collect this data at home, BTW, so the Java issues have meant that, for the last two years, only a handful of kids have successfully been able to use the applet at home and, without anyone for troubleshooting, they quickly give up.

I'll also say that the approach of summing over the normal modes to find the solution for a given f, L, etc. gives a much neater animation than using a finite element/balls and springs model of the string and waiting for the old waves to damp out. It's idealized, but we're really just looking for the steady-state here anyway - this just gets us there faster. It will make the computer work, though!

The most significant difference here is that I haven't created the draggable ruler, opting instead for more prominent gridlines. I always wanted to measure the amplitude anyway, so the horizontal ruler in the applet didn't help much, but using the grid and some arbitrary 'block' unit should be able to serve both purposes.

Let me know if that is an important feature for you, or if there's anything else that you can think of to add or modify to increase the usefulness of this applet! Click through the photo for the applet itself.

Sunday, July 13, 2014

Longitudinal Wave Simulation

In the wake of the big Java security crisis, Java applets have become increasingly inaccessible and/or onerous to use, due to security settings. Add to this issues like Java 7 needing a 64 bit browser in OSX and Linux, and it's rather difficult to get a classroom set of computers, much less a BYOD environment, to effectively run Java applets in class.

I've found that I can just forget asking students to use them at home, given their computer setups and ability to navigate these complications. Because some of my favorite applets seem to be going extinct, I'm going to try to duplicate as many as I can in Glowscript, which is a kind of mashup between JavaScript and VPython. It has much of the readability and ease of VPython, and can run in WebGL-enabled broswers, which covers most situations (maybe just 'many' in the mobile world, at this point). More importantly, that coverage is on the way up, while Java is on the way down.

My first applet is an attempt to replace Walter Fendt's longitudinal standing waves animation. I love this for my students - it's difficult for them to picture particle motion in longitudinal pulses, but nearly impossible for them to visualize what the particles are doing in a longitudinal standing wave. This depiction is obviously idealized, but it can help them get over that hump.

The second thing that I like about this setup is that it shows SW diagrams/graphs of not only particle displacement, but also the change in pressure. At this point in class, we've been merrily drawing standing wave diagrams for waves in tube as if they were waves on strings (or some kind of string that can have an unconstrained end or two). What have we actually been drawing? This helps to clarify that we had been illustrating the change in position of the particles and shows that we can also describe the change in pressure that they undergo. Looking back up at the animation gives students a sense of why the two trends are related the way that they are.

I've decided to leave out (at least for now) the numerical data on the side, as I hadn't generally found much use for it. Perhaps I'll add it - let me know if you see a good reason for including that.

Click through the screenshot for the applet itself - enjoy!