View Javadoc
1   package org.djunits.unit;
2   
3   import org.djunits.quantity.Quantity;
4   import org.djunits.unit.scale.IdentityScale;
5   import org.djunits.unit.scale.LinearScale;
6   import org.djunits.unit.si.SIPrefixes;
7   import org.djunits.unit.unitsystem.UnitSystem;
8   
9   /**
10   * Units for electrical charge.
11   * <p>
12   * Copyright (c) 2015-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13   * BSD-style license. See <a href="https://djunits.org/docs/license.html">DJUNITS License</a>.
14   * </p>
15   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
16   */
17  public class ElectricalChargeUnit extends Unit<ElectricalChargeUnit>
18  {
19      /** */
20      private static final long serialVersionUID = 20140607L;
21  
22      /** The base, with "sA" as the SI signature. */
23      public static final Quantity<ElectricalChargeUnit> BASE = new Quantity<>("ElectricalCharge", "sA");
24  
25      /** The SI unit for electrical charge is Coulomb = A.s. */
26      public static final ElectricalChargeUnit SI = new ElectricalChargeUnit()
27              .build(new Unit.Builder<ElectricalChargeUnit>().setQuantity(BASE).setId("C").setName("coulomb")
28                      .setUnitSystem(UnitSystem.SI_DERIVED).setSiPrefixes(SIPrefixes.UNIT, 1.0).setScale(IdentityScale.SCALE));
29  
30      /** Coulomb = A.s. */
31      public static final ElectricalChargeUnit COULOMB = SI;
32  
33      /** microCoulomb = muA.s. */
34      public static final ElectricalChargeUnit MICROCOULOMB = COULOMB.deriveSI(SIPrefixes.getUnit("mu"), 1.0);
35  
36      /** milliCoulomb = mA.s. */
37      public static final ElectricalChargeUnit MILLICOULOMB = COULOMB.deriveSI(SIPrefixes.getUnit("m"), 1.0);
38  
39      /** ampere hour. */
40      public static final ElectricalChargeUnit AMPERE_HOUR =
41              new ElectricalChargeUnit().build(new Unit.Builder<ElectricalChargeUnit>().setQuantity(BASE).setId("Ah")
42                      .setName("ampere hour").setUnitSystem(UnitSystem.SI_DERIVED).setSiPrefixes(SIPrefixes.UNIT, 1.0)
43                      .setScale(new LinearScale(3600.0)));
44  
45      /** milliampere hour. */
46      public static final ElectricalChargeUnit MILLIAMPERE_HOUR = AMPERE_HOUR.deriveSI(SIPrefixes.getUnit("m"), 1.0);
47  
48      /** milliampere second. */
49      public static final ElectricalChargeUnit MILLIAMPERE_SECOND =
50              AMPERE_HOUR.deriveLinear(1.0 / 3600.0, "mAs", "milliampere second");
51  
52      /** kiloampere hour. */
53      public static final ElectricalChargeUnit KILOAMPERE_HOUR = AMPERE_HOUR.deriveSI(SIPrefixes.getUnit("k"), 1.0);
54  
55      /** megaampere hour. */
56      public static final ElectricalChargeUnit MEGAAMPERE_HOUR = AMPERE_HOUR.deriveSI(SIPrefixes.getUnit("M"), 1.0);
57  
58      /** Faraday. */
59      public static final ElectricalChargeUnit FARADAY = COULOMB.deriveLinear(96485.3383, "F", "faraday", UnitSystem.OTHER);
60  
61      /** atomic unit of charge. This value is exact since the 2019 redefinition of the SI base units. */
62      public static final ElectricalChargeUnit ATOMIC_UNIT =
63              COULOMB.deriveLinear(1.602176634E-19, "e", "elementary unit of charge", UnitSystem.SI_ACCEPTED);
64  
65      /** statcoulomb (CGS ESU). */
66      public static final ElectricalChargeUnit STATCOULOMB =
67              COULOMB.deriveLinear(3.335641E-10, "statC", "statcoulomb", UnitSystem.CGS_ESU);
68  
69      /** franklin (CGS ESU). */
70      public static final ElectricalChargeUnit FRANKLIN = STATCOULOMB.deriveLinear(1.0, "Fr", "franklin");
71  
72      /** esu (CGS ESU). */
73      public static final ElectricalChargeUnit ESU = STATCOULOMB.deriveLinear(1.0, "esu", "electrostatic unit");
74  
75      /** abcoulomb (CGS EMU). */
76      public static final ElectricalChargeUnit ABCOULOMB = COULOMB.deriveLinear(10.0, "abC", "abcoulomb", UnitSystem.CGS_EMU);
77  
78      /** emu (CGS EMU). */
79      public static final ElectricalChargeUnit EMU = ABCOULOMB.deriveLinear(1.0, "emu", "electromagnetic unit");
80  
81  }