PDA

View Full Version : Flash Gravity Model Erroneous, Help Please


alt_f13
August 17th, 2003, 5:19 PM
www.djglacial.com/gravity/

^ This is a gravity model. For some reason that I cannot determine, the time scales are completely wrong, by about 40000 days per second of the simulation.

You can find the code at www.djglacial.com/gravity/code.txt

and a full browser version of the sim at www.djglacial.com/gravity/gravity.swf

Please help me figure this out !!!!

Knowlege of Flash ActionScript or BASIC could help, but not neccessary.

Keep in mind this is Gr12 physics, so you physics buffs should not have much of a problem spotting the problem (which is probably just a dumb math problem, not a physics problem.)

alt_f13
August 18th, 2003, 5:42 PM
I cant believe this subject is SO boring that it only got ONE view besides me... let alone a reply.

o_0

I would be appreciative of any help, as I just cannot spot the problem after a few weeks of coming back to it.

Edit - I even color coded the variables ;)

dave
August 19th, 2003, 3:50 PM
that's a nice applet you've got there :)

unfortunately I can't be bothered to wade through the text atm, so I'll look later, but I'd agree that something's wrong for sure.

blike
August 19th, 2003, 4:07 PM
I'm not exactly sure what the problem is. What should days per second be?

alt_f13
August 19th, 2003, 6:39 PM
Ill look through it and post again in a bit.

Right now, when it should be 365 days per second, and the radius of the orbit is the same as earths, it should take about one second for the planet to orbit the sun in the simulation. However, I have to boost the days per second to 40000 days per second for it to appear right.

I will make a modification so that the planet orbits at the proper distance when the app starts and when you press a button. That will make the error more apparant.

alt_f13
August 19th, 2003, 6:55 PM
Wow, this is very unorganized. Rather than using vitual data, it makes calculations based on the objects position in the app itself. I am going to rewrite this and post again a little later, hopefully with an error free version.

You can still take a look at the code, perhaps spot the problem. But don't think too hard about it.

alt_f13
August 19th, 2003, 9:40 PM
The code.txt is now irrelivant.

The app has changed quite a bit, especially the fundamental code. There are still some major errors, but the erroneous statistical data is interesting.

www.djglacial.com/gravity

alt_f13
August 23rd, 2003, 5:23 AM
ALRIGHT!!!

It is almost working !!! It still has some fundamental flaws I cannot figure out.

Would you take a look at the code and app. Note the new days per second edit field!!!!

www.djglacial.com/gravity/

www.djglacial.com/gravity/code.txt