diff --git a/src/amuse/units/constants_original.py b/src/amuse/units/constants_original.py new file mode 100644 index 0000000000..113ed9682f --- /dev/null +++ b/src/amuse/units/constants_original.py @@ -0,0 +1,351 @@ +""" +Physical constants +""" +# This is an auto generated file, do not change manually. Instead if you want +# to add constants or change them, change the nist.txt file and run nist.py + +import numpy +from amuse.units.si import m, kg, s, A, K, mol, none +from amuse.units.derivedsi import Hz, MHz, sr, N, Pa, J, W, F, C, V, T, ohm, S, Wb + +# BASE UNITS*********************************************** +X220X_lattice_spacing_of_silicon = 1.920155762e-10 | m +alpha_particle_mass = 6.6446562e-27 | kg +alpha_particle_mass_energy_equivalent = 5.97191917e-10 | J +Angstrom_star = 1.00001498e-10 | m +u = 1.660538782e-27 | kg +atomic_mass_constant_energy_equivalent = 1.49241783e-10 | J +atomic_mass_unit_hyphen_hertz_relationship = 2.2523427369e23 | Hz +atomic_mass_unit_hyphen_joule_relationship = 1.49241783e-10 | J +atomic_mass_unit_hyphen_kelvin_relationship = 1.0809527e13 | K +atomic_mass_unit_hyphen_kilogram_relationship = 1.660538782e-27 | kg +atomic_unit_of_charge = 1.602176487e-19 | C +atomic_unit_of_current = 0.00662361763 | A +atomic_unit_of_electric_potential = 27.21138386 | V +atomic_unit_of_energy = 4.35974394e-18 | J +atomic_unit_of_force = 8.23872206e-08 | N +atomic_unit_of_length = 5.2917720859e-11 | m +atomic_unit_of_mag_flux_density = 235051.7382 | T +atomic_unit_of_mass = 9.10938215e-31 | kg +atomic_unit_of_time = 2.4188843265e-17 | s +Bohr_radius = 5.2917720859e-11 | m +characteristic_impedance_of_vacuum = 376.730313461 | ohm +classical_electron_radius = 2.8179402894e-15 | m +Compton_wavelength = 2.4263102175e-12 | m +Compton_wavelength_over_2_pi = 3.8615926459e-13 | m +conductance_quantum = 7.7480917004e-05 | S +conventional_value_of_von_Klitzing_constant = 25812.807 | ohm +Cu_x_unit = 1.00207699e-13 | m +deuteron_mass = 3.3435832e-27 | kg +deuteron_mass_energy_equivalent = 3.00506272e-10 | J +deuteron_rms_charge_radius = 2.1402e-15 | m +electron_mass = 9.10938215e-31 | kg +electron_mass_energy_equivalent = 8.18710438e-14 | J +electron_volt = 1.602176487e-19 | J +electron_volt_hyphen_hertz_relationship = 2.417989454e14 | Hz +electron_volt_hyphen_joule_relationship = 1.602176487e-19 | J +electron_volt_hyphen_kelvin_relationship = 11604.505 | K +electron_volt_hyphen_kilogram_relationship = 1.782661758e-36 | kg +elementary_charge = 1.602176487e-19 | C +Hartree_energy = 4.35974394e-18 | J +hartree_hyphen_hertz_relationship = 6.57968392072e15 | Hz +hartree_hyphen_joule_relationship = 4.35974394e-18 | J +hartree_hyphen_kelvin_relationship = 315774.65 | K +hartree_hyphen_kilogram_relationship = 4.85086934e-35 | kg +helion_mass = 5.00641192e-27 | kg +helion_mass_energy_equivalent = 4.49953864e-10 | J +hertz_hyphen_joule_relationship = 6.62606896e-34 | J +hertz_hyphen_kelvin_relationship = 4.7992374e-11 | K +hertz_hyphen_kilogram_relationship = 7.372496e-51 | kg +inverse_meter_hyphen_hertz_relationship = 299792458.0 | Hz +inverse_meter_hyphen_joule_relationship = 1.986445501e-25 | J +inverse_meter_hyphen_kelvin_relationship = 0.014387752 | K +inverse_meter_hyphen_kilogram_relationship = 2.2102187e-42 | kg +inverse_of_conductance_quantum = 12906.4037787 | ohm +joule_hyphen_hertz_relationship = 1.50919045e33 | Hz +joule_hyphen_kelvin_relationship = 7.242963e22 | K +joule_hyphen_kilogram_relationship = 1.112650056e-17 | kg +kelvin_hyphen_hertz_relationship = 20836644000.0 | Hz +kelvin_hyphen_joule_relationship = 1.3806504e-23 | J +kelvin_hyphen_kilogram_relationship = 1.5361807e-40 | kg +kilogram_hyphen_hertz_relationship = 1.356392733e50 | Hz +kilogram_hyphen_joule_relationship = 8.987551787e16 | J +kilogram_hyphen_kelvin_relationship = 6.509651e39 | K +lattice_parameter_of_silicon = 5.43102064e-10 | m +mag_flux_quantum = 2.067833667e-15 | Wb +Mo_x_unit = 1.00209955e-13 | m +muon_Compton_wavelength = 1.173444104e-14 | m +muon_Compton_wavelength_over_2_pi = 1.867594295e-15 | m +muon_mass = 1.8835313e-28 | kg +muon_mass_energy_equivalent = 1.69283351e-11 | J +natural_unit_of_energy = 8.18710438e-14 | J +natural_unit_of_length = 3.8615926459e-13 | m +natural_unit_of_mass = 9.10938215e-31 | kg +natural_unit_of_time = 1.288088657e-21 | s +neutron_Compton_wavelength = 1.3195908951e-15 | m +neutron_Compton_wavelength_over_2_pi = 2.1001941382e-16 | m +neutron_mass = 1.674927211e-27 | kg +neutron_mass_energy_equivalent = 1.505349505e-10 | J +Planck_length = 1.616252e-35 | m +Planck_mass = 2.17644e-08 | kg +Planck_temperature = 1.416785e32 | K +Planck_time = 5.39124e-44 | s +proton_Compton_wavelength = 1.3214098446e-15 | m +proton_Compton_wavelength_over_2_pi = 2.1030890861e-16 | m +proton_mass = 1.672621637e-27 | kg +proton_mass_energy_equivalent = 1.503277359e-10 | J +proton_rms_charge_radius = 8.768e-16 | m +Rydberg_constant_times_c_in_Hz = 3.28984196036e15 | Hz +Rydberg_constant_times_hc_in_J = 2.17987197e-18 | J +standard_atmosphere = 101325.0 | Pa +tau_Compton_wavelength = 6.9772e-16 | m +tau_Compton_wavelength_over_2_pi = 1.11046e-16 | m +tau_mass = 3.16777e-27 | kg +tau_mass_energy_equivalent = 2.84705e-10 | J +triton_mass = 5.00735588e-27 | kg +triton_mass_energy_equivalent = 4.50038703e-10 | J +unified_atomic_mass_unit = 1.660538782e-27 | kg +von_Klitzing_constant = 25812.807557 | ohm +# DERIVED UNITS*********************************************** +alpha_particle_molar_mass = 0.00400150617913 | kg * mol**-1 +atomic_mass_unit_hyphen_inverse_meter_relationship = 7.513006671e14 | m**-1 +atomic_unit_of_1st_hyperpolarizablity = 3.206361533e-53 | C**3 * m**3 * J**-2 +atomic_unit_of_2nd_hyperpolarizablity = 6.23538095e-65 | C**4 * m**4 * J**-3 +atomic_unit_of_action = 1.054571628e-34 | J * s +atomic_unit_of_charge_density = 1.0812023e12 | C * m**-3 +atomic_unit_of_electric_dipole_mom = 8.47835281e-30 | C * m +atomic_unit_of_electric_field = 5.14220632e11 | V * m**-1 +atomic_unit_of_electric_field_gradient = 9.71736166e21 | V * m**-2 +atomic_unit_of_electric_polarizablity = 1.6487772536e-41 | C**2 * m**2 * J**-1 +atomic_unit_of_electric_quadrupole_mom = 4.48655107e-40 | C * m**2 +atomic_unit_of_mag_dipole_mom = 1.85480183e-23 | J * T**-1 +atomic_unit_of_magnetizability = 7.891036433e-29 | J * T**-2 +atomic_unit_of_momentum = 1.992851565e-24 | kg * m * s**-1 +atomic_unit_of_permittivity = 1.112650056e-10 | F * m**-1 +atomic_unit_of_velocity = 2187691.2541 | m * s**-1 +Avogadro_constant = 6.02214179e23 | mol**-1 +Bohr_magneton = 9.27400915e-24 | J * T**-1 +Bohr_magneton_in_Hz_div_T = 13996246040.0 | Hz * T**-1 +Bohr_magneton_in_inverse_meters_per_tesla = 46.6864515 | m**-1 * T**-1 +Bohr_magneton_in_K_div_T = 0.6717131 | K * T**-1 +kB = 1.3806504e-23 | J * K**-1 +Boltzmann_constant_in_Hz_div_K = 20836644000.0 | Hz * K**-1 +Boltzmann_constant_in_inverse_meters_per_kelvin = 69.50356 | m**-1 * K**-1 +conventional_value_of_Josephson_constant = 4.835979e14 | Hz * V**-1 +deuteron_mag_mom = 4.33073465e-27 | J * T**-1 +deuteron_molar_mass = 0.00201355321272 | kg * mol**-1 +electric_constant = 8.854187817e-12 | F * m**-1 +electron_charge_to_mass_quotient = -1.75882015e11 | C * kg**-1 +electron_gyromag_ratio = 1.76085977e11 | s**-1 * T**-1 +electron_gyromag_ratio_over_2_pi = 28024.95364 | MHz * T**-1 +electron_mag_mom = -9.28476377e-24 | J * T**-1 +electron_molar_mass = 5.4857990943e-07 | kg * mol**-1 +electron_volt_hyphen_inverse_meter_relationship = 806554.465 | m**-1 +elementary_charge_over_h = 2.417989454e14 | A * J**-1 +Faraday_constant = 96485.3399 | C * mol**-1 +first_radiation_constant = 3.74177118e-16 | W * m**2 +first_radiation_constant_for_spectral_radiance = 1.191042759e-16 | W * m**2 * sr**-1 +hartree_hyphen_inverse_meter_relationship = 21947463.137 | m**-1 +helion_molar_mass = 0.0030149322473 | kg * mol**-1 +hertz_hyphen_inverse_meter_relationship = 3.335640951e-09 | m**-1 +Josephson_constant = 4.83597891e14 | Hz * V**-1 +joule_hyphen_inverse_meter_relationship = 5.03411747e24 | m**-1 +kelvin_hyphen_inverse_meter_relationship = 69.50356 | m**-1 +kilogram_hyphen_inverse_meter_relationship = 4.52443915e41 | m**-1 +Loschmidt_constant_X27315_K_and__101325_kPaX = 2.6867774e25 | m**-3 +mag_constant = 1.2566370614e-06 | N * A**-2 +molar_gas_constant = 8.314472 | J * mol**-1 * K**-1 +molar_mass_constant = 0.001 | kg * mol**-1 +molar_mass_of_carbon_hyphen_12 = 0.012 | kg * mol**-1 +molar_Planck_constant = 3.9903126821e-10 | J * s * mol**-1 +molar_Planck_constant_times_c = 0.11962656472 | J * m * mol**-1 +molar_volume_of_ideal_gas_X27315_K_and__100_kPaX = 0.022710981 | m**3 * mol**-1 +molar_volume_of_ideal_gas_X27315_K_and__101325_kPaX = 0.022413996 | m**3 * mol**-1 +molar_volume_of_silicon = 1.20588349e-05 | m**3 * mol**-1 +muon_mag_mom = -4.49044786e-26 | J * T**-1 +muon_molar_mass = 0.0001134289256 | kg * mol**-1 +natural_unit_of_action = 1.054571628e-34 | J * s +natural_unit_of_momentum = 2.73092406e-22 | kg * m * s**-1 +natural_unit_of_velocity = 299792458.0 | m * s**-1 +neutron_gyromag_ratio = 183247185.0 | s**-1 * T**-1 +neutron_gyromag_ratio_over_2_pi = 29.1646954 | MHz * T**-1 +neutron_mag_mom = -9.6623641e-27 | J * T**-1 +neutron_molar_mass = 0.00100866491597 | kg * mol**-1 +G = 6.67428e-11 | m**3 * kg**-1 * s**-2 +nuclear_magneton = 5.05078324e-27 | J * T**-1 +nuclear_magneton_in_inverse_meters_per_tesla = 0.02542623616 | m**-1 * T**-1 +nuclear_magneton_in_K_div_T = 0.00036582637 | K * T**-1 +nuclear_magneton_in_MHz_div_T = 7.62259384 | MHz * T**-1 +h = 6.62606896e-34 | J * s +Planck_constant_over_2_pi = 1.054571628e-34 | J * s +proton_charge_to_mass_quotient = 95788339.2 | C * kg**-1 +proton_gyromag_ratio = 267522209.9 | s**-1 * T**-1 +proton_gyromag_ratio_over_2_pi = 42.5774821 | MHz * T**-1 +proton_mag_mom = 1.410606662e-26 | J * T**-1 +proton_molar_mass = 0.00100727646677 | kg * mol**-1 +quantum_of_circulation = 0.00036369475199 | m**2 * s**-1 +quantum_of_circulation_times_2 = 0.000727389504 | m**2 * s**-1 +Rydberg_constant = 10973731.5685 | m**-1 +second_radiation_constant = 0.014387752 | m * K +shielded_helion_gyromag_ratio = 203789473.0 | s**-1 * T**-1 +shielded_helion_gyromag_ratio_over_2_pi = 32.43410198 | MHz * T**-1 +shielded_helion_mag_mom = -1.074552982e-26 | J * T**-1 +shielded_proton_gyromag_ratio = 267515336.2 | s**-1 * T**-1 +shielded_proton_gyromag_ratio_over_2_pi = 42.5763881 | MHz * T**-1 +shielded_proton_mag_mom = 1.410570419e-26 | J * T**-1 +c = 299792458.0 | m * s**-1 +standard_acceleration_of_gravity = 9.80665 | m * s**-2 +Stefan_hyphen_Boltzmann_constant = 5.6704e-08 | W * m**-2 * K**-4 +tau_molar_mass = 0.00190768 | kg * mol**-1 +Thomson_cross_section = 6.652458558e-29 | m**2 +triton_mag_mom = 1.504609361e-26 | J * T**-1 +triton_molar_mass = 0.0030155007134 | kg * mol**-1 +Wien_frequency_displacement_law_constant = 58789330000.0 | Hz * K**-1 +Wien_wavelength_displacement_law_constant = 0.0028977685 | m * K +# RATIOS *********************************************** +alpha_particle_hyphen_electron_mass_ratio = 7294.2995365 | none +alpha_particle_hyphen_proton_mass_ratio = 3.97259968951 | none +deuteron_hyphen_electron_mag_mom_ratio = -0.0004664345537 | none +deuteron_hyphen_electron_mass_ratio = 3670.4829654 | none +deuteron_g_factor = 0.8574382308 | none +deuteron_mag_mom_to_Bohr_magneton_ratio = 0.0004669754556 | none +deuteron_mag_mom_to_nuclear_magneton_ratio = 0.8574382308 | none +deuteron_hyphen_neutron_mag_mom_ratio = -0.44820652 | none +deuteron_hyphen_proton_mag_mom_ratio = 0.307012207 | none +deuteron_hyphen_proton_mass_ratio = 1.99900750108 | none +electron_hyphen_deuteron_mag_mom_ratio = -2143.923498 | none +electron_hyphen_deuteron_mass_ratio = 0.00027244371093 | none +electron_g_factor = -2.00231930436 | none +electron_mag_mom_anomaly = 0.00115965218111 | none +electron_mag_mom_to_Bohr_magneton_ratio = -1.00115965218 | none +electron_mag_mom_to_nuclear_magneton_ratio = -1838.28197092 | none +electron_hyphen_muon_mag_mom_ratio = 206.7669877 | none +electron_hyphen_muon_mass_ratio = 0.00483633171 | none +electron_hyphen_neutron_mag_mom_ratio = 960.9205 | none +electron_hyphen_neutron_mass_ratio = 0.00054386734459 | none +electron_hyphen_proton_mag_mom_ratio = -658.2106848 | none +electron_hyphen_proton_mass_ratio = 0.00054461702177 | none +electron_hyphen_tau_mass_ratio = 0.000287564 | none +electron_to_alpha_particle_mass_ratio = 0.00013709335557 | none +electron_to_shielded_helion_mag_mom_ratio = 864.058257 | none +electron_to_shielded_proton_mag_mom_ratio = -658.2275971 | none +fine_hyphen_structure_constant = 0.0072973525376 | none +helion_hyphen_electron_mass_ratio = 5495.8852765 | none +helion_hyphen_proton_mass_ratio = 2.9931526713 | none +inverse_fine_hyphen_structure_constant = 137.035999679 | none +muon_hyphen_electron_mass_ratio = 206.7682823 | none +muon_g_factor = -2.0023318414 | none +muon_mag_mom_anomaly = 0.00116592069 | none +muon_mag_mom_to_Bohr_magneton_ratio = -0.00484197049 | none +muon_mag_mom_to_nuclear_magneton_ratio = -8.89059705 | none +muon_hyphen_neutron_mass_ratio = 0.1124545167 | none +muon_hyphen_proton_mag_mom_ratio = -3.183345137 | none +muon_hyphen_proton_mass_ratio = 0.1126095261 | none +muon_hyphen_tau_mass_ratio = 0.0594592 | none +neutron_hyphen_electron_mag_mom_ratio = 0.00104066882 | none +neutron_hyphen_electron_mass_ratio = 1838.6836605 | none +neutron_g_factor = -3.82608545 | none +neutron_mag_mom_to_Bohr_magneton_ratio = -0.00104187563 | none +neutron_mag_mom_to_nuclear_magneton_ratio = -1.91304273 | none +neutron_hyphen_muon_mass_ratio = 8.89248409 | none +neutron_hyphen_proton_mag_mom_ratio = -0.68497934 | none +neutron_hyphen_proton_mass_ratio = 1.00137841918 | none +neutron_hyphen_tau_mass_ratio = 0.52874 | none +neutron_to_shielded_proton_mag_mom_ratio = -0.68499694 | none +proton_hyphen_electron_mass_ratio = 1836.15267247 | none +proton_g_factor = 5.585694713 | none +proton_mag_mom_to_Bohr_magneton_ratio = 0.001521032209 | none +proton_mag_mom_to_nuclear_magneton_ratio = 2.792847356 | none +proton_mag_shielding_correction = 2.5694e-05 | none +proton_hyphen_muon_mass_ratio = 8.88024339 | none +proton_hyphen_neutron_mag_mom_ratio = -1.45989806 | none +proton_hyphen_neutron_mass_ratio = 0.99862347824 | none +proton_hyphen_tau_mass_ratio = 0.528012 | none +Sackur_hyphen_Tetrode_constant_X1_K_and__100_kPaX = -1.1517047 | none +Sackur_hyphen_Tetrode_constant_X1_K_and__101325_kPaX = -1.1648677 | none +shielded_helion_mag_mom_to_Bohr_magneton_ratio = -0.001158671471 | none +shielded_helion_mag_mom_to_nuclear_magneton_ratio = -2.127497718 | none +shielded_helion_to_proton_mag_mom_ratio = -0.761766558 | none +shielded_helion_to_shielded_proton_mag_mom_ratio = -0.7617861313 | none +shielded_proton_mag_mom_to_Bohr_magneton_ratio = 0.001520993128 | none +shielded_proton_mag_mom_to_nuclear_magneton_ratio = 2.792775598 | none +tau_hyphen_electron_mass_ratio = 3477.48 | none +tau_hyphen_muon_mass_ratio = 16.8183 | none +tau_hyphen_neutron_mass_ratio = 1.89129 | none +tau_hyphen_proton_mass_ratio = 1.8939 | none +triton_hyphen_electron_mag_mom_ratio = -0.001620514423 | none +triton_hyphen_electron_mass_ratio = 5496.9215269 | none +triton_g_factor = 5.957924896 | none +triton_mag_mom_to_Bohr_magneton_ratio = 0.001622393657 | none +triton_mag_mom_to_nuclear_magneton_ratio = 2.978962448 | none +triton_hyphen_neutron_mag_mom_ratio = -1.55718553 | none +triton_hyphen_proton_mag_mom_ratio = 1.066639908 | none +triton_hyphen_proton_mass_ratio = 2.9937170309 | none +weak_mixing_angle = 0.22255 | none +# DERIVED CONSTANTS*********************************************** +pi = numpy.pi +hbar = h / (2.0 * numpy.pi) +four_pi_stefan_boltzmann = 4.0 * numpy.pi * Stefan_hyphen_Boltzmann_constant +mu0 = 4 * numpy.pi * 1.0e-7 | N / A**2 +eps0 = mu0**-1 * c**-2 +sidereal_day = 86164.100352 | s +# machine constants +eps = numpy.finfo(numpy.double).eps +precision = int(numpy.log10(2 / eps)) +# DROPPED UNITS*********************************************** +"""alpha_particle_mass_energy_equivalent_in_MeV = 3727.379109 | MeV +alpha_particle_mass_in_u = 4.00150617913 | u +atomic_mass_constant_energy_equivalent_in_MeV = 931.494028 | MeV +atomic_mass_unit_hyphen_electron_volt_relationship = 931494028.0 | eV +atomic_mass_unit_hyphen_hartree_relationship = 34231777.149 | E_h +Bohr_magneton_in_eV_div_T = 5.7883817555e-05 | eV*T**-1 +kBeV = 8.617343e-05 | eV*K**-1 +deuteron_mass_energy_equivalent_in_MeV = 1875.612793 | MeV +deuteron_mass_in_u = 2.01355321272 | u +electron_mass_energy_equivalent_in_MeV = 0.51099891 | MeV +electron_mass_in_u = 0.00054857990943 | u +electron_volt_hyphen_atomic_mass_unit_relationship = 1.073544188e-09 | u +electron_volt_hyphen_hartree_relationship = 0.0367493254 | E_h +Faraday_constant_for_conventional_electric_current = 96485.3401 | C_90*mol**-1 +Fermi_coupling_constant = 1.16637e-05 | GeV**-2 +hartree_hyphen_atomic_mass_unit_relationship = 2.9212622986e-08 | u +hartree_hyphen_electron_volt_relationship = 27.21138386 | eV +Hartree_energy_in_eV = 27.21138386 | eV +helion_mass_energy_equivalent_in_MeV = 2808.391383 | MeV +helion_mass_in_u = 3.0149322473 | u +hertz_hyphen_atomic_mass_unit_relationship = 4.4398216294e-24 | u +hertz_hyphen_electron_volt_relationship = 4.13566733e-15 | eV +hertz_hyphen_hartree_relationship = 1.51982984601e-16 | E_h +inverse_meter_hyphen_atomic_mass_unit_relationship = 1.3310250394e-15 | u +inverse_meter_hyphen_electron_volt_relationship = 1.239841875e-06 | eV +inverse_meter_hyphen_hartree_relationship = 4.55633525276e-08 | E_h +joule_hyphen_atomic_mass_unit_relationship = 6700536410.0 | u +joule_hyphen_electron_volt_relationship = 6.24150965e+18 | eV +joule_hyphen_hartree_relationship = 2.29371269e+17 | E_h +kelvin_hyphen_atomic_mass_unit_relationship = 9.251098e-14 | u +kelvin_hyphen_electron_volt_relationship = 8.617343e-05 | eV +kelvin_hyphen_hartree_relationship = 3.1668153e-06 | E_h +kilogram_hyphen_atomic_mass_unit_relationship = 6.02214179e+26 | u +kilogram_hyphen_electron_volt_relationship = 5.60958912e+35 | eV +kilogram_hyphen_hartree_relationship = 2.06148616e+34 | E_h +muon_mass_energy_equivalent_in_MeV = 105.6583668 | MeV +muon_mass_in_u = 0.1134289256 | u +natural_unit_of_action_in_eV_s = 6.58211899e-16 | eV*s +natural_unit_of_energy_in_MeV = 0.51099891 | MeV +natural_unit_of_momentum_in_MeV_div_c = 0.51099891 | MeV/c +neutron_mass_energy_equivalent_in_MeV = 939.565346 | MeV +neutron_mass_in_u = 1.00866491597 | u +Newtonian_constant_of_gravitation_over_h_hyphen_bar_c = 6.70881e-39 | (GeV/c**2)**-2 +nuclear_magneton_in_eV_div_T = 3.1524512326e-08 | eV*T**-1 +heV = 4.13566733e-15 | eV*s +Planck_constant_over_2_pi_in_eV_s = 6.58211899e-16 | eV*s +Planck_constant_over_2_pi_times_c_in_MeV_fm = 197.3269631 | MeV*fm +Planck_mass_energy_equivalent_in_GeV = 1.220892e+19 | GeV +proton_mass_energy_equivalent_in_MeV = 938.272013 | MeV +proton_mass_in_u = 1.00727646677 | u +Rydberg_constant_times_hc_in_eV = 13.60569193 | eV +tau_mass_energy_equivalent_in_MeV = 1776.99 | MeV +tau_mass_in_u = 1.90768 | u +triton_mass_energy_equivalent_in_MeV = 2808.920906 | MeV +triton_mass_in_u = 3.0155007134 | u +""" diff --git a/src/amuse/units/units.py b/src/amuse/units/units.py index 92f2fb8c3d..fbfd2b4d81 100644 --- a/src/amuse/units/units.py +++ b/src/amuse/units/units.py @@ -1,5 +1,7 @@ """ -Units supported in AMUSE +Units supported in AMUSE - 2025 version +Values are taken to be the same as in Astropy (default unit set). +If/when they are not, this file should be updated. """ import numpy @@ -21,7 +23,7 @@ minute = named("minute", "min", 60.0 * s) hour = named("hour", "hr", 60.0 * minute) day = named("day", "day", 24.0 * hour) -yr = named("year", "yr", 365.242199 * day) +yr = named("year", "yr", 365.25 * day) julianyr = named("julian yr", "julianyr", 365.25 * day) ms = named("meter per seconds", "ms", m / s) kms = named("kilometer per seconds", "kms", km / s) @@ -43,20 +45,20 @@ # astronomical units angstrom = named("angstrom", "angstrom", 1e-10 * m) -au = named("astronomical unit", "au", 149597870691.0 * m) -aud = named("au per day", "aud", 149597870691.0 * m / day) +au = named("astronomical unit", "au", 149597870700.0 * m) +aud = named("au per day", "aud", au / day) parsec = named("parsec", "parsec", au / numpy.tan(numpy.pi / (180 * 60 * 60))) kpc = named("kilo parsec", "kpc", 10**3 * parsec) Mpc = named("mega parsec", "Mpc", 10**6 * parsec) Gpc = named("giga parsec", "Gpc", 10**9 * parsec) -lightyear = named("light year", "ly", 9460730472580.8 * km) -LSun = named("solar luminosity", "LSun", 3.839e26 * W, latex=r"L_{\odot}") -MSun = named("solar mass", "MSun", 1.98892e30 * kg, latex=r"M_{\odot}") -RSun = named("solar radius", "RSun", 6.955e8 * m, latex=r"R_{\odot}") -MJupiter = named("jupiter mass", "MJupiter", 1.8987e27 * kg) -RJupiter = named("jupiter radius", "RJupiter", 71492.0 * km) -MEarth = named("earth mass", "MEarth", 5.9722e24 * kg) -REarth = named("earth radius", "REarth", 6371.0088 * km) # IUGG mean radius +lightyear = named("light year", "ly", 9460730472580800.0 * m) +LSun = named("solar luminosity", "LSun", 3.828e26 * W, latex=r"L_{\odot}") +MSun = named("solar mass", "MSun", 1.988409870698051e+30 * kg, latex=r"M_{\odot}") +RSun = named("solar radius", "RSun", 695700000.0 * m, latex=r"R_{\odot}") +MJupiter = named("jupiter mass", "MJupiter", 1.8981245973360505e+27 * kg) +RJupiter = named("jupiter radius", "RJupiter", 71492000.0 * m) +MEarth = named("earth mass", "MEarth", 5.972167867791379e+24 * kg) +REarth = named("earth radius", "REarth", 6378100.0 * m) # IUGG mean radius kyr = named("kilo year", "kyr", 1000 * yr) myr = named("million year", "Myr", 1000000 * yr) gyr = named("giga (billion) year", "Gyr", 1000000000 * yr) @@ -83,8 +85,9 @@ # imperial distance units inch = named("inch", "in", 0.0254 * m) -foot = named("foot", "ft", 0.3048 * m) -mile = named("mile", "mi", 1609.344 * m) +foot = named("foot", "ft", 12 * inch) +yard = named("yard", "yd", 3 * foot) +mile = named("mile", "mi", 5280 * foot) percent = named("percent", "%", 0.01 * none) metallicity = core.none_unit("metallicity", "metallicity") diff --git a/src/amuse/units/units_original.py b/src/amuse/units/units_original.py new file mode 100644 index 0000000000..92f2fb8c3d --- /dev/null +++ b/src/amuse/units/units_original.py @@ -0,0 +1,102 @@ +""" +Units supported in AMUSE +""" + +import numpy +from . import constants +from . import quantities + +# The two imports below are to explicitly expose everything directly used in +# this module. +from .si import (named, s, m, kg, none, core, no_unit,) +from .derivedsi import (km, V, W, J, Pa, rad,) + +# importing * from si and derivedsi since we do want all of the units in these +# modules, and we don't want to repeat everything here. +from .si import * +from .derivedsi import * +from .stellar_types import stellar_type + +# misc every day +minute = named("minute", "min", 60.0 * s) +hour = named("hour", "hr", 60.0 * minute) +day = named("day", "day", 24.0 * hour) +yr = named("year", "yr", 365.242199 * day) +julianyr = named("julian yr", "julianyr", 365.25 * day) +ms = named("meter per seconds", "ms", m / s) +kms = named("kilometer per seconds", "kms", km / s) + +# units based on measured quantities +e = named("electron charge", "e", constants.elementary_charge.as_unit()) +eV = named("electron volt", "eV", e * V) +MeV = named("mega electron volt", "MeV", 1e6 * eV) +GeV = named("giga electron volt", "GeV", 1e9 * eV) +E_h = named("hartree energy", "E_h", constants.Hartree_energy.as_unit()) +amu = named("atomic mass unit", "amu", constants.u.as_unit()) +Ry = named( + "rydberg unit", + "Ry", + (constants.Rydberg_constant * constants.h * constants.c) + .as_quantity_in(eV) + .as_unit(), +) + +# astronomical units +angstrom = named("angstrom", "angstrom", 1e-10 * m) +au = named("astronomical unit", "au", 149597870691.0 * m) +aud = named("au per day", "aud", 149597870691.0 * m / day) +parsec = named("parsec", "parsec", au / numpy.tan(numpy.pi / (180 * 60 * 60))) +kpc = named("kilo parsec", "kpc", 10**3 * parsec) +Mpc = named("mega parsec", "Mpc", 10**6 * parsec) +Gpc = named("giga parsec", "Gpc", 10**9 * parsec) +lightyear = named("light year", "ly", 9460730472580.8 * km) +LSun = named("solar luminosity", "LSun", 3.839e26 * W, latex=r"L_{\odot}") +MSun = named("solar mass", "MSun", 1.98892e30 * kg, latex=r"M_{\odot}") +RSun = named("solar radius", "RSun", 6.955e8 * m, latex=r"R_{\odot}") +MJupiter = named("jupiter mass", "MJupiter", 1.8987e27 * kg) +RJupiter = named("jupiter radius", "RJupiter", 71492.0 * km) +MEarth = named("earth mass", "MEarth", 5.9722e24 * kg) +REarth = named("earth radius", "REarth", 6371.0088 * km) # IUGG mean radius +kyr = named("kilo year", "kyr", 1000 * yr) +myr = named("million year", "Myr", 1000000 * yr) +gyr = named("giga (billion) year", "Gyr", 1000000000 * yr) + +# alternatives, for compatibility +AU = au +AUd = aud +Myr = myr +Gyr = gyr +pc = parsec +Lsun = LSun +Msun = MSun +Rsun = RSun +Mjupiter = MJupiter +Rjupiter = RJupiter +Mearth = MEarth +Rearth = REarth + +# cgs units +g = named("gram", "g", 1e-3 * kg) +cm = named("centimeter", "cm", 0.01 * m) +erg = named("erg", "erg", 1e-7 * J) +barye = named("barye", "Ba", 0.1 * Pa) + +# imperial distance units +inch = named("inch", "in", 0.0254 * m) +foot = named("foot", "ft", 0.3048 * m) +mile = named("mile", "mi", 1609.344 * m) + +percent = named("percent", "%", 0.01 * none) +metallicity = core.none_unit("metallicity", "metallicity") + +string = core.string_unit("string", "string") + +# special unit for keys of particles +object_key = core.key_unit("object_key", "key") + +# angles +pi = numpy.pi | rad +rev = named("revolutions", "rev", (2 * numpy.pi) * rad) +deg = named("degree", "deg", (numpy.pi / 180) * rad) +arcmin = named("arcminutes", "arcmin", (1.0 / 60) * deg) +arcsec = named("arcseconds", "arcsec", (1.0 / 3600) * deg)