图片解析应用
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.

43 lines
1.6 KiB

  1. """
  2. MKS unit system.
  3. MKS stands for "meter, kilogram, second, ampere".
  4. """
  5. from typing import List
  6. from sympy.physics.units.definitions import Z0, A, C, F, H, S, T, V, Wb, ohm
  7. from sympy.physics.units.definitions.dimension_definitions import (
  8. capacitance, charge, conductance, current, impedance, inductance,
  9. magnetic_density, magnetic_flux, voltage)
  10. from sympy.physics.units.prefixes import PREFIXES, prefix_unit
  11. from sympy.physics.units.systems.mks import MKS, dimsys_length_weight_time
  12. from sympy.physics.units.quantities import Quantity
  13. dims = (voltage, impedance, conductance, current, capacitance, inductance, charge,
  14. magnetic_density, magnetic_flux)
  15. units = [A, V, ohm, S, F, H, C, T, Wb]
  16. all_units = [] # type: List[Quantity]
  17. for u in units:
  18. all_units.extend(prefix_unit(u, PREFIXES))
  19. all_units.append(Z0)
  20. dimsys_MKSA = dimsys_length_weight_time.extend([
  21. # Dimensional dependencies for base dimensions (MKSA not in MKS)
  22. current,
  23. ], new_dim_deps=dict(
  24. # Dimensional dependencies for derived dimensions
  25. voltage=dict(mass=1, length=2, current=-1, time=-3),
  26. impedance=dict(mass=1, length=2, current=-2, time=-3),
  27. conductance=dict(mass=-1, length=-2, current=2, time=3),
  28. capacitance=dict(mass=-1, length=-2, current=2, time=4),
  29. inductance=dict(mass=1, length=2, current=-2, time=-2),
  30. charge=dict(current=1, time=1),
  31. magnetic_density=dict(mass=1, current=-1, time=-2),
  32. magnetic_flux=dict(length=2, mass=1, current=-1, time=-2),
  33. ))
  34. MKSA = MKS.extend(base=(A,), units=all_units, name='MKSA', dimension_system=dimsys_MKSA)