Examples#

This gallery walks through physicskit.astro’s worked examples: orbital mechanics, N-body dynamics, stellar structure, galactic dynamics and dark matter, cosmic-web structure formation, and the stellar dynamo – one section per corresponding subpackage module.

See also the narrative tutorials:

Each script in this gallery is self-contained and can be run directly with python examples/astro/<section>/<script>.py. Every script also carries an RST module docstring as its title/description and uses # %% markers to split narrative text from code, which is exactly what Sphinx-Gallery renders into the pages below – the script is the source of truth for what you see, not a copy of it.

Sections#

  • orbital_mechanics – Kepler’s laws, Newton’s inverse-square gravity, Gauss’s orbit-determination problem, and the Hohmann transfer.

  • nbody – Poincare’s sensitive dependence in the three-body problem, the figure-eight choreography, the virial theorem, and long-term symplectic stability.

  • stellar_structure – Lane-Emden polytropes, the Chandrasekhar mass limit, the Eddington mass-luminosity relation, and the pp-chain/CNO-cycle energy release behind stellar nucleosynthesis.

  • galactic_dynamics – Oort’s constants, flat rotation curves and the dark-matter mass discrepancy, the NFW halo profile, and Chandrasekhar’s dynamical friction.

  • cosmic_web – the Zel’dovich approximation: a uniform particle grid collapsing into the filaments, sheets, and nodes of the cosmic web.

  • stellar_dynamo – 2D Boussinesq convective rolls, and the linearized alpha-omega mean-field dynamo wave that reproduces the solar butterfly diagram.

Cosmic-web formation#

The Zel’dovich (1970) approximation: how an initially uniform grid of matter collapses into the filaments, sheets, and nodes of the cosmic web.

Cosmic-web formation: the Zel’dovich approximation

Cosmic-web formation: the Zel'dovich approximation

Galactic dynamics#

Oort and Lindblad’s differential rotation, Rubin and Ford’s flat rotation curves, the Navarro-Frenk-White halo profile, and Chandrasekhar’s dynamical friction – the rotation-curve and dark-matter machinery in physicskit.astro.galactic_dynamics.

Oort and Lindblad’s differential rotation: the Oort constants

Oort and Lindblad's differential rotation: the Oort constants

Rotation curves, the NFW halo, and the dark-matter mass discrepancy

Rotation curves, the NFW halo, and the dark-matter mass discrepancy

Chandrasekhar’s dynamical friction: a satellite spiraling inward

Chandrasekhar's dynamical friction: a satellite spiraling inward

N-body dynamics#

Direct-summation gravity in physicskit.astro.nbody: the sensitive dependence on initial conditions Poincare discovered in the three-body problem, the figure-eight choreography, the virial theorem, and the long-term stability that symplectic integration buys N-body simulation.

Poincare’s discovery: sensitive dependence in the three-body problem

Poincare's discovery: sensitive dependence in the three-body problem

The figure-eight three-body choreography

The figure-eight three-body choreography

Clausius’s virial theorem for a bound gravitational orbit

Clausius's virial theorem for a bound gravitational orbit

Symplectic integration and long-term N-body stability

Symplectic integration and long-term N-body stability

Orbital mechanics#

Kepler’s laws, Newton’s inverse-square gravity, Gauss’s orbit-determination problem, and Hohmann’s minimum-energy transfer – the two-body machinery in physicskit.astro.orbital_mechanics.

Kepler’s laws and Newton’s inverse-square gravity

Kepler's laws and Newton's inverse-square gravity

Gauss’s problem: recovering orbital elements from a state vector

Gauss's problem: recovering orbital elements from a state vector

Hohmann’s minimum-energy transfer orbit

Hohmann's minimum-energy transfer orbit

Stellar convection and the magnetic dynamo#

2D convective rolls, and the alpha-omega mean-field dynamo wave behind the solar butterfly diagram.

Stellar convection and the alpha-omega magnetic dynamo

Stellar convection and the alpha-omega magnetic dynamo

Stellar structure#

Polytropic gas spheres, the Chandrasekhar mass limit, the mass-luminosity relation, and the nuclear reactions that power a star, from physicskit.astro.stellar_structure (and, for nucleosynthesis, physicskit.particle.nuclear).

Lane-Emden polytropes: Lane, Ritter, and Emden’s gas spheres

Lane-Emden polytropes: Lane, Ritter, and Emden's gas spheres

Chandrasekhar’s white dwarf mass limit

Chandrasekhar's white dwarf mass limit

Eddington’s mass-luminosity relation

Eddington's mass-luminosity relation

Bethe’s pp-chain and CNO cycle: the energy source of stars

Bethe's pp-chain and CNO cycle: the energy source of stars

Gallery generated by Sphinx-Gallery