QB64.org Forum

Active Forums => Programs => Topic started by: STxAxTIC on February 09, 2019, 05:51:04 pm

Title: Gravity Challenge!
Post by: STxAxTIC on February 09, 2019, 05:51:04 pm
Since there are 4 or 5 people following the threads about gravity and planets, I figure I'd cook up a problem to stir the pot even more. Here it is:

Suppose a planet on a circular orbit goes around the sun in T=1 year (whatever a year is for that planet). If the planet were to suddenly stop moving in an instant, precisely how long will it take for the planet to fall into the sun? Express the answer as a fraction of T.
Title: Re: Gravity Challenge!
Post by: Pete on February 09, 2019, 05:54:13 pm
Since there are 4 or 5 people following the threads about gravity and planets, I figure I'd cook up a problem to stir the pot even more. Here it is:

Suppose a planet on a circular orbit goes around the sun in T=1 year. If the planet were to suddenly stop moving in an instant, precisely how long will it take for the planet to fall into the sun? Express the answer as a fraction of T.

The "program" will fall into the sun at the exact same time the planet does... provided the program is running on said planet.

I hope you get someone else to write test questions for your students

Pete:D
Title: Re: Gravity Challenge!
Post by: STxAxTIC on February 09, 2019, 05:55:01 pm
Motherf*cker haha, responded before I could fix that typo.
Title: Re: Gravity Challenge!
Post by: Pete on February 09, 2019, 06:02:49 pm
I'm also pretty sure you that slang is two words, but I digress...

A couple of months.

Mass of our sun: 1.99 x 1033 grams.

Distance of a planet that orbits said sun in 1 year: 1.50 x 1013 centimeters.

Now the other bodies around the planet about to be disintegrated will have a minimal effect on the acceleration, but it will mostly be the pull of the sun that will increase the speed of the "fall" over time.

How am I dong so far?

Oops, almost forgot to throw in Newton's gravitational constant... 6.67 x 10-8 centimeters cubed per second squared per gram.

So we should be looking at: Time = ( R3 / GM)1/2

So about 65 days, but we would also need to know if it is a surface to surface or cent to cent collision.

Pete
Title: Re: Gravity Challenge!
Post by: STxAxTIC on February 09, 2019, 06:35:55 pm
Pretty good start to the analysis actually. How precisely you extracted T=65 days from the equations you cited is still mysterious to me though. Did you use a program or just a calculator? (Was the program a web browser?)

What if the planet we're talking about isn't Earth, which has... whatever... a 700 day year. How would your answer change?
Title: Re: Gravity Challenge!
Post by: Pete on February 09, 2019, 07:48:26 pm
That would be Mars, and you'd have to ask Mark, since that's where's he's from. Of course if his planet lost gravity, he'd be to busy holding his skirt down to answer!

Pete
Title: Re: Gravity Challenge!
Post by: STxAxTIC on February 09, 2019, 08:07:48 pm
Challenge is still open, even though Pete's number does in fact work for Earth. (Something tells me he used the Internet to copy the result instead of writing a program. Not necessarily a bad thing on his part!) The third option would have been calculus.
Title: Re: Gravity Challenge!
Post by: Qwerkey on February 10, 2019, 04:27:44 am
The third option would have been calculus.

Third option?  As this is a mathematical problem, it is the obvious "option"?  That'd be Newton again.

And of course I concur that the conic section of the correct sort is exactly the mathematical form for a two-body Newtonian gravity path.
Title: Re: Gravity Challenge!
Post by: johnno56 on February 10, 2019, 06:57:19 am
Ok. Where to begin. Firstly we will stipulate that there is a force in the Solar System capable of bringing our planet to a complete stop. Setting the orbits of all the planets to one of circular would also infer that the relationships between each planet and the ecliptic plane would be set to zero. Like marbles rolling on a flat surface. 65 days would sound just about right if you ruled out the problem of the Sun's gravitational effect on a now stationary object. That far from the Sun; So much inertia to overcome; that's going to take time for the Earth to reach terminal velocity. But it eventually will. Now that the planets are on the same plane, the gravitational effects of Venus and Mercury, would come into play. Maybe no so much with mercury. If we are lucky Venus may not be an issue, but Mercury on the other hand, maybe too small to have much of an influence on our flight path, but it's orbital period would allow perhaps a chance of collision. But, I don't think that will be an issue, as we all would be pretty much barbecued as we pass the orbit of Venus. Since we were rendered motionless, our own gravitational field would have been weakened, as such, most of our atmosphere would gradually "leak" into space. With our atmosphere almost depleted, Solar radiation, would pretty much finish us all off long before we hit the Sun... Then the alarm clock goes off and we wake from a terrible nightmare... That was fun. Let's do another one...

Hmm... a 700 day year scenario. Too difficult to calculate. The only parameter given is that the planet "is not Earth". The size or mass of the planet will play a huge part in said planet's demise... In either case, the only winners in either theory, will be the manufacturer's of Sun Screen Lotion... I wonder what SP factor will be required? lol
Title: Re: Gravity Challenge!
Post by: Qwerkey on February 10, 2019, 07:19:47 am
Johnno, are you over-thinking this?  As I understand it, STxAxTIC has set a theoretical problem.  We assume that a planet is at distance R from its (nearly infinite mass with respect to its own mass) sun, and travelling at its orbital speed v.  Newton gives a relationship between R and v (and therefore the orbital period, the year).

Then STxAxTIC wants us to calculate the time it would take for the same planet stationary at distance R from the same sun to travel into that sun.  I had a quick look at the mathematics required: d2x/dt2 proportional to 1/x2 and couldn't do the calculus.  I suspect that there is a nice relationship between this time and the year.

I'm hoping that STxAxTIC will help us stupid folks with the maths solution.  Is there an analytical solution?  How I managed my engineering career with such poor maths remains one of Nature's mysteries.
Title: Re: Gravity Challenge!
Post by: STxAxTIC on February 10, 2019, 07:44:46 am
I love that this question exploded in its own little way. To clear up some points:

(i) It doesn't matter "how" the planet stopped in the first place. Just imagine superman got involved, or a very weird asteroid fly-by, or anything.

(ii) Don't worry about other solar system entities, such as the gravitation of Jupiter, Mercury/Venus being in the way, etc.

(iii) Assume both the Earth and the Sun are points rather than spheres. (This is 100% allowed for this calculation down to a tiny correction not worth mentioning.) This means we're only concerning over center-to-center distance from Earth to sun.

More notes:

If I were to solve this without calculus, I would need a program to simulate the 1/r^2 attraction. The idea would be to set up the sun in the middle, and a planet orbiting in a circular fashion. Measurement "A" would be the time it takes or the planet to complete one circle. Next, run the same simulation but give the planet no orbital speed so it falls right into the sun. That time will be measurement "B". The ratio B/A would be the answer.

To solve this using calculus entails only calc-101-level skills plus conservation of energy (which I'm sure everyone believes in).

The final hint is you need to know nothing about the actual solar system data. Masses, original distances, and so on - all cancel out from the final result.
Title: Re: Gravity Challenge!
Post by: Qwerkey on February 10, 2019, 07:53:16 am
Having failed with the calculus method, I used my Gravitation Simulation program (qv) in manual data input mode, with Sun and Earth at set masses and starting distance.  The calulated time is just over 58 days, which seeing that the orbital period is 365.25 days give a ratio of just over 6: would this be 2pi?

Title: Re: Gravity Challenge!
Post by: STxAxTIC on February 10, 2019, 08:09:31 am
Nice run Qwerkey!

Since this thread is really all about the method and not the final result, I'll drop the hint that the analytical answer is sqrt(2)/8, which evaluates to roughly 0.177.

Comparing this to your ratio of 58/365.25 = 0.159, it is not bad whatsoever. I'll consider this a correct answer all day.

The nice thing about having theoretical results on hand is they can be used to test a simulation/program. This says whatever methods you're using are pretty sound!

Eh, screw it, I won't rewrite my existing solution because the iron may cool down before I get a chance. Below are the two pages of calculus (first one optional if you already believe in energy conservation). You can see the final result, once compared to the T^2~a^3 equation deduced by Kepler (Pete wrote this for us way above), reduces simply to sqr(2)/8 with no wiggle room.
Title: Re: Gravity Challenge!
Post by: Qwerkey on February 10, 2019, 08:23:40 am
Wow!  STxAxTIC, thanks.

Title: Re: Gravity Challenge!
Post by: johnno56 on February 10, 2019, 03:11:52 pm
Querkey,

"Over thinking". Of course I am. Where is the fun in NOT doing so. lol Astronomy has, is and will always be a fascinating subject for me. So, when presented with such a problem, I couldn't resist...  I'm not very good with math. "How can that be if you are interested in Astronomy?" you might ask. I used my eyes and a telescope long before I wanted to know "how" it all works... Sure, I can do the basic (no pun intended) stuff to calculate planetary positions, but that's about my limit. I was never taught calculus... Ha. That's for clever people...  Sorry. I get a bit carried away when it comes to space and stuff... The fact that my caffeine levels are WAY too low may have something to do with it... lol
Title: Re: Gravity Challenge!
Post by: Pete on February 10, 2019, 03:46:30 pm
Qwerkey is such a pessimist. At least I'll outlive him... by 6 days, apparently! This integral calculus is all well and good, but most of this theoretical stuff is considered acceptable within a 10% deviation of results. Well, screw this theoretical crap. Let's find out for sure. Johnno, when I count to three, you get on the floor and push as hard as you can. When the planet stops orbiting, Mark, who lives on Mars, anyway, you start the timer. My guess is Qwerkey will have at least 6 days to apologize to me!

Oh well, like the astro-proctoligists all say... "It's ironic we know everything about mercury to Neptune and Pluto, but to get paid, we have to look up Uranus.

Pete :D 
Title: Re: Gravity Challenge!
Post by: Qwerkey on February 11, 2019, 04:58:41 am
Well, I would have apologised but for the scatological pun.  And I must try and find where those extra days went.

Title: Re: Gravity Challenge!
Post by: Qwerkey on February 13, 2019, 01:11:04 pm
I have had a further look at why my ratio came out wrong - tested against all the orbital periods of Mercury to Pluto, the Gravitation Simulation program is very accurate.

I redid the model for Earth-Sun and got a time of 61 days (must have put in an incorrect distance previously): this gives a ratio of 0.167, still not the correct value of 0.177.

Then I ran the model for Jupiter-Sun and that gave a value of 0.176.  Now that is respectable.

Title: Re: Gravity Challenge!
Post by: Qwerkey on February 14, 2019, 10:40:25 am
I realised that I had been misinterpreting the elapsed time output of my Gravity Simulation program (you'd think that I'd know what I was doing!).  So I redid the Earth calculation and then did one for Pluto (in addition to the one for Jupiter above).

STxAxTIC's ratio for Earth is 0.178 and for Pluto is 0.177 compared to the theoretical 0.177.

So, the program is, after all, accurate (as it should be).
Title: Re: Gravity Challenge!
Post by: STxAxTIC on February 14, 2019, 11:02:28 am
Holy cow Qwerkey!

Way to persist on the issue. It's always super satisfying when simulation and theory agree at the important milestones. It gives a little hope that the simulation is correct when there is no theoretical case to test against. Bravo for seeing this calculation through to the end.
Title: Re: Gravity Challenge!
Post by: Qwerkey on February 15, 2019, 05:41:34 am
STxAxTIC, just to show you that I'm not fiddling the results, here's a screen capture video of an Earth-Sun collapse run of my Gravitation Program.  The start data are: Mass of Sun 1.99E30 kg, Mass of Earth 5.97E24 kg, Sun at zero, Earth at x = 1.5E8 km.

When the run is executed, the Earth (green dot/trace) moves towards the Sun in the middle.  The jumping to the right of the Earth on occasions is when the display is zoomed in.  The Earth speeds up towards the Sun and when it gets to the position of the Sun, the Program is halted.  Then reading the Elapsed Time gives the value of just over 65 days.
Title: Re: Gravity Challenge!
Post by: STxAxTIC on February 15, 2019, 09:05:20 am
Awesome, a real bang-up job on that one! It's efforts like this that force a person to believe in calculus in they only know simulation, or to believe in simulation if they only know calculus. Handy use of InForm as well!

Not to mention the flattering icon of Newton. Images of Newton make me laugh. Sometimes he looks like a powdered whig judge, other times he's depicted as the no-chin alchemist he truly was, who never got laid, ever... And then there are the flattering images: nice squared-off jaw, modern-ish hair, etc. History's been nice to that guy - for very good reason I suppose. I wonder if in 2000 years we'll be arguing as to whether or not he was a white guy, or yet another pseudonym of Francis Bacon or something.

Bravo for seeing this one to the end. (Pretty sure Pete used Google to come up with his number!)
Title: Re: Gravity Challenge!
Post by: Pete on February 15, 2019, 10:42:49 am
(Pretty sure Pete used Google to come up with his number!)

I find that highly insulting. Anybody with half a brain knows when I put my mind to accomplish something... I use Bing.

Pete :D
Title: Re: Gravity Challenge!
Post by: Pete on February 19, 2019, 09:49:07 am
Excuse me, we are real coders. We don;t GOTO our corners, we EXIT the ring!

Happy searching. I took some time off to go mattress shopping Monday, so see if you can buy me an extra day.

Pete