HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Python Labs
  2. /Finding L1 by bisection
Space Science and AstronomyAdvancedHigh School (11–12)Celestial Mechanics and Spaceflight

Finding L1 by bisection

You will find the L1 point of two bodies by bisection, in the frame that turns with them. Distances are in units of the separation, and qqq is the small mass over the large one.

The idea. Put the centre of mass at 000, the large body at x1=−q/(1+q)x_1 = -q/(1 + q)x1​=−q/(1+q) and the small one at x2=1/(1+q)x_2 = 1/(1 + q)x2​=1/(1+q). In these units a body at rest in the turning frame at the point xxx between them feels the net pull

f(x)=x−1(1+q)(x−x1)2+q(1+q)(x2−x)2\displaystyle f(x) = x - \dfrac{1}{(1 + q)(x - x_1)^2} + \dfrac{q}{(1 + q)(x_2 - x)^2}f(x)=x−(1+q)(x−x1​)21​+(1+q)(x2​−x)2q​

L1 is where f(x)=0f(x) = 0f(x)=0. Bisection halves an interval again and again, keeping the half where fff changes sign.

Your tasks.

  1. In net_pull, return f(x)f(x)f(x) for a point between the bodies.
  2. In bisect, carry out 606060 halvings of the interval lo to hi and return its middle.
  3. In hill, return the Hill estimate (q/3)1/3(q/3)^{1/3}(q/3)1/3 of the distance from the small body.

Run it first, just as it is. The checker at the end prints FAIL for each task. Then do the tasks one at a time, and run the program again after each one. A Hint appears under every check that still fails.

When every line says PASS, find L1 for the Earth and the Moon, with q=0.0123q = 0.0123q=0.0123, and compare it with the Hill estimate.

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A worked solution

Run your code once to unlock the worked solution.

Have you tried it?

Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.

Log in to save
← All Labs
← A Hohmann transfer plannerNext →
More onCelestial Mechanics and Spaceflight

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. A Hohmann transfer plannerHard
  2. An orbit step by stepAdvanced
  3. What kind of orbit is it?Hard
  4. A Kepler's equation solverHard
  5. Orbits from their two endsHard
All labs on this topic →