Saturday, August 06, 2005

End of summer

Once again, they are bouncing... I think. The way that Tarynn came up with to troubleshoot my calculations suggested a shortcut in the calculations. A really short shortcut actually--it took like ten minutes to program in. And now what John said a few weeks ago finally makes sense--the only part of the vector that needs to be changed is the part that is normal to the plane that it is hitting. So instead of setting up a local coordinate system and using trig to flip the vector around, we can take the vector and change the sign on the coordinate that corresponds to the wall it is hitting. It seems strange that it would be that easy so I want to test it a lot more. I learned a LOT more about vectors than I would have if I had just started out with swapping the sign though. So I think greater confidence when dealing with vectors is worth the extra work.

I ran some tests with the new way of calculating: first with the parasites starting in the middle and then bouncing straight back and forth against the walls (left-right, top-bottom, and front-back) and then I also tried one where the parasites bounce back and forth catty-corner. It passed with flying colors. I also tried one where the parasite hits the middle of each side (right, back, left, front, etc). That one also worked. So eventually I made a file with around a hundred parasites all milling around and it looks pretty good.

It did look like it was doing a few strange things though. Occasionally it looked like the parasites were skating along the wall a small distance before taking off again. Occasionally it also looked like they were bouncing against the same wall twice. It was a little difficult to see, and it could just be the 3D perspective. I may need to run the binary file through Ford's program and actually look at the numbers. I can't think of anything in the program that would cause this, but we'll see.

I'm keeping a copy of the latest versions of the prototype--both the new way of calculating and the other way too (I spent too much time on it to delete it. and it may come in handy later). Both are commented like crazy so I should be able to figure out what is going on if I come back to it later. I also wrote up a readme and I'm putting together a CD for Tarynn with just about everything on it. When I get home I need to burn my own copy of the CD too.

The summer ends how it began--with lots of paperwork and presentations. Check my website in a day or two for links to my research presentation and my research proposal for the academic year.

Tuesday, August 02, 2005

They Bounce! (mostly)

Well, in the process of testing the program to figure out why the parasites were sticking I found a problem. As it turns out, I had tried to be cute and given the program too many normals to choose from which made the parasites keep updating to the same velocity which made them look like they were sticking on the wall. So I fixed that, but I found out that when the parasites are bounced straight off of the ceiling, floor, back, or front, they will also stick. Because when the prime axes are calculated they come out to (0, 0, 0) which makes everything zero when the vector is updated. So I'm waiting to talk to Tarynn on this because it's a problem with either the math or how I'm understanding and programming the math and I'm not sure how to fix it in a mathematically legal way. I'm not exactly sure that some of the vectors are reflecting properly, but since they reflect correctly off of the walls which are working (the right and left) I'm going to focus on fixing one problem at a time.

The good news is that I can run the simulation and watch parasites bounce off of walls ad infinitum as long as none of them try to run straight into walls. On the last simulation I ran only two out of ten parasites stuck. But I'm going to need to add a lot more to this because, quite frankly, it looks silly. Parasites don't just bounce back and forth between two walls, they change direction. However, it looks like I will have at least something to show for this summer, lol.

Philippians 4:6-7, 2 Timothy 1:7.