A Current
value represents an electrical current in amperes.
Note that since Amperes
is defined as Rate Coulombs Seconds
(charge
per unit time), you can construct a Current
value using Quantity.per
:
current =
charge |> Quantity.per duration
You can also do rate-related calculations with Current
values to compute
Charge
or Duration
:
charge =
current |> Quantity.for duration
alsoCharge =
duration |> Quantity.at current
duration =
charge |> Quantity.at_ current
Current
Current.Amperes
amperes : Basics.Float -> Current
Construct a current from a number of amperes.
inAmperes : Current -> Basics.Float
Convert a current to a number of amperes.
Charge.coulombs 10
|> Quantity.per (Duration.seconds 2)
|> Current.inAmperes
--> 5
milliamperes : Basics.Float -> Current
Construct a current from a number of milliamperes.
Current.milliamperes 500
--> Current.amperes 0.5
inMilliamperes : Current -> Basics.Float
Convert a current to number of milliamperes.
Current.amperes 2 |> Current.inMilliamperes
--> 2000