numerical

Numerical Calculations - what to use?

I like numerical calculations. I think they are useful. But what should I use to create my calculations in? I am still not sure. Here are my options:
  • VPython: I think this is the easiest for me to create things in. Python is uber-simple and the visual module has most of what I want. VPython 4 is currently in development and will run in Mac OS X without using X11 - so that is good. One bad thing about vpython is that it seems a little slower than java. I could be wrong about that though. The other big problem with vpython is the question of how to share simulations. It would be great if you could embed vpython in a webpage, but you can't. A user would have to download the code, install vpython and run it. This is ok if one is using it for courses, but not if you want a more general audience to look at it. Oh, vpython is free. One more thing, I feel comfortable creating stuff in vpython.
  • Java. On its own, I probably wouldn't consider this. However, there is opensource physics. Opensource physics is a set of java "stuff" that allows you to create java calculations without doing all the crazy (programming) stuff. You still have to compile the programs, but it gets a lot of the difficult stuff out of the way. This stuff looks pretty powerful, but with great power comes a greater responsibility to do good, and I am just not sure I can do good. Really the problem is that java is pretty darn complicated compared to vpython. I can crank out some pretty simple stuff in vpython WAY quicker than in java. On the plus side, java is free AND you can make apps that can be run from the web, so a user would only need to have java installed - many do have this.
  • Flash: Flash is pretty with its vector-based graphics. Also, I am told it can do many of the things java can do. But to tell you the truth, I really don't "get it". What Josh, what don't you get? So, its a robot that turns into a building? What's fun about that? I tried making a simple program, but there are too many new terms that just plain confuse me. Another problem is that this sucker is not free, nor cheap. I have a friend that is big into flash, he keeps telling me I can get into it fairly quickly. So the two big pluses are - it looks good, runs in web pages. But it is not free. If I get into flash and I want students to do flash stuff, they can't because they won't have it. Also, what is AIR? Is that free? I never figured out what air is.
  • M.S. Excel. What? Are you kidding? This is a great tool for basic calculations and a great way to involve students, but I can't stand using spreadsheets for calculations. I hate highlighting cells and graphing and all that stuff. Yes, there are some great free spreadsheets, but for me I will not use them for this stuff.
So that is where I am. Stuck.

Another note about simulations

I mentioned this previously, but this came up again. Here is a diagram from a resource letter on computational physics:
screenshot_11
The idea represented is that somehow simulations are different than theory and experiment. Read on for my response to the editor. I am posting it here because I doubt it will be published.
Read More...

Computational Physics - its theory

I just want to say that I really like computers. I like doing physics with computers. Its great, I can sit here and work on physics stuff at the same time as checking email and listening to music and stuff. Numerical calculations are awesome. I also see lots of people promoting computational physics, but there is a problem. A common way to pitch the idea of computational physics is to say its like a 3rd way to do physics, the three ways being:
  • Theory
  • Experiment
  • Computation
I have a problem with this. Computation is not a third thing, instead it is a type of theoretical calculation.
Suppose I want to apply a model of a ball falling without air resistance. How could I study this? Here are some options:
  • I could use Newtonian mechanics and integrate starting with F = ma (most people would call this theory)
  • I could drop a ball and make a video of it falling. Using this I could get position and time data from the video. (most people would call this an experiment)
  • I could also create a numerical calculation using VPython or Excel to generate the position of the ball at different times. (most people would call this computational physics) - It is fine with me to call this computational physics, but it is really no different than theory.
Theoretical physics takes some known model and calculates "stuff" from that model. This is exactly what computational physics does, but it does not use analytic tools like calculus, instead it uses a numerical tool.

The important thing to realize is the starting and ending points for theoretical and computational are the same. Computational is definitely NOT experimental physics.


Air Resistance of a falling tennis ball

Suppose I want to have a lab activity with a dropping tennis ball. Do I need to worry about air resistance or can I assume there is none? This is a that was recently asked of me. Below is my answer: Read More...

Numerical Calculations for Everyday Use

You may have seen this before as it was on my old server. It has recently been moved over to this server. In case you don't know what a numerical calculation is, let me give brief summary.

Suppose I throw a ball up in the air and I want to determine how long it is in the air. I could start with the kinematic equations for motion with a constant acceleration:
Pasted Graphic Solving this for time would be what I call an analytical solution (my terms might be slightly different than other peoples - but they can adjust). In an analytical solution, one basically starts with some expression and algebraically (or using differential equations) solve for an unknown variable. In this case, I could get y(t) - which would pretty much be more than you are looking for.

Now for Numerical calculations: Read More...