gonzales.lib.physics¶
- gonzales.lib.physics.calc_com(r, m)¶
Calculates center of mass of a set of particles.
- Parameters
r – N x 3 numpy array, position vectors of the particles
m – N x 1 numpy array, mass vector of the particles
- Returns
1 x 3 numpy array, center of mass
- gonzales.lib.physics.calc_ke(v, m)¶
Calculates kinetic energy of a system of particles.
- Parameters
v – N x 3 numpy array, velocity vectors of the particles
m – N x 1 numpy array, mass vector of the particles
- Returns
double, kinetic energy of the system
- gonzales.lib.physics.calc_pe(r, m, G, eps)¶
Calculates potential energy of a system of particles.
- Parameters
r – N x 3 numpy array, position vectors of the particles
m – N x 1 numpy array, mass vector of the particles
G – gravitational constant
eps – gravitational softening
- Returns
double, potential energy of the system
- gonzales.lib.physics.calc_te(r, v, m, G, eps)¶
Calculates total mechanical energy of a system of particles.
- Parameters
r – N x 3 numpy array, position vectors of the particles
v – N x 3 numpy array, velocity vectors of the particles
m – N x 1 numpy array, mass vector of the particles
G – gravitational constant
eps – gravitational softening
- Returns
double, total mechanical energy of the system
- gonzales.lib.physics.calc_ang_mom(r, v, m)¶
Calculates angular momentum of a system of particles.
- Parameters
r – N x 3 numpy array, position vectors of the particles
v – N x 3 numpy array, velocity vectors of the particles
m – N x 1 numpy array, mass vector of the particles
- Returns
1 x 3 numpy array, angular momentum vector