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. /A Hohmann transfer planner
Space Science and AstronomyHardHigh School (11–12)Celestial Mechanics and Spaceflight

A Hohmann transfer planner

You will write a planner for transfers between circular orbits round the Sun. Distances are in AU, speeds in km/s, times in days.

The idea. The circular speed is 29.79 km/s×1/r29.79\ \text{km/s} \times \sqrt{1/r}29.79 km/s×1/r​. The transfer has at=(r1+r2)/2a_t = (r_1 + r_2)/2at​=(r1​+r2​)/2. At each end, vis-viva gives the speed on the transfer orbit, 29.792/r−1/at29.79\sqrt{2/r - 1/a_t}29.792/r−1/at​​. The burns are the differences, and the coast is half a period, 12at1.5×365.25\tfrac{1}{2}a_t^{1.5} \times 365.2521​at1.5​×365.25 days.

Your tasks.

  1. In circular_speed, return the circular speed at r.
  2. In burns, return the two burns (dv1, dv2), both as positive numbers.
  3. In coast_days, return the coast time in days.

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, plan a transfer from the Earth to an asteroid at 2.8 AU2.8\ \text{AU}2.8 AU.

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
← An orbit step by stepFinding L1 by bisection →
More onCelestial Mechanics and Spaceflight

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. Finding L1 by bisectionAdvanced
  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 →