m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

7 months ago
  1. """
  2. MKS unit system.
  3. MKS stands for "meter, kilogram, second".
  4. """
  5. from sympy.physics.units import UnitSystem, DimensionSystem
  6. from sympy.physics.units.definitions import G, Hz, J, N, Pa, W, c, g, kg, m, s
  7. from sympy.physics.units.definitions.dimension_definitions import (
  8. acceleration, action, energy, force, frequency, momentum,
  9. power, pressure, velocity, length, mass, time)
  10. from sympy.physics.units.prefixes import PREFIXES, prefix_unit
  11. from sympy.physics.units.systems.length_weight_time import dimsys_length_weight_time
  12. dims = (velocity, acceleration, momentum, force, energy, power, pressure,
  13. frequency, action)
  14. units = [m, g, s, J, N, W, Pa, Hz]
  15. all_units = []
  16. # Prefixes of units like g, J, N etc get added using `prefix_unit`
  17. # in the for loop, but the actual units have to be added manually.
  18. all_units.extend([g, J, N, W, Pa, Hz])
  19. for u in units:
  20. all_units.extend(prefix_unit(u, PREFIXES))
  21. all_units.extend([G, c])
  22. # unit system
  23. MKS = UnitSystem(base_units=(m, kg, s), units=all_units, name="MKS", dimension_system=dimsys_length_weight_time)
  24. __all__ = [
  25. 'force', 'DimensionSystem', 'energy', 'Pa', 'MKS',
  26. 'dimsys_length_weight_time', 'Hz', 'power', 's', 'UnitSystem', 'units',
  27. 'mass', 'momentum', 'acceleration', 'G', 'J', 'N', 'pressure', 'W',
  28. 'all_units', 'c', 'kg', 'g', 'dims', 'prefix_unit', 'm', 'PREFIXES',
  29. 'length', 'frequency', 'u', 'time', 'action', 'velocity',
  30. ]