Skip to content

Commit c13f66e

Browse files
committed
Electric
Rearranged some of the electrical units, all with the prefix "Electric", and labeled the following classes as obsolete: * ApparentEnergy -> ElectricApparentEnergy * ApparentPower -> ElectricApparentPower * Capacitance -> ElectricCapacitance * ReactiveEnergy -> ElectricReactiveEnergy * ReactivePower -> ElectricReactivePower Added classes for ElectricReactance and ElectricSusceptance. Labeled ElectricPotentialAc and ElectricPotentialDc as obsolete per discussion. Labeled ElectricAdmittance as obsolete due to it being a complex number. Decided against adding ElectricImpedance for the same reason. Added math to ElectricCurrent.extra.cs and ElectricPotential.extra.cs to support ElectricApparentPower Added math for ElectricApparentPower.extra.cs Minor correction to formula in comment of Power.extra.cs
1 parent 83063d3 commit c13f66e

22 files changed

+282
-5
lines changed

Common/UnitDefinitions/ApparentEnergy.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"Name": "ApparentEnergy",
33
"BaseUnit": "VoltampereHour",
44
"XmlDocSummary": "A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules.",
5+
"ObsoleteText": "This class is obsolete. Please use ElectricApparentEnergy instead",
56
"BaseDimensions": {
67
"L": 2,
78
"M": 1,

Common/UnitDefinitions/ApparentPower.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"Name": "ApparentPower",
33
"BaseUnit": "Voltampere",
44
"XmlDocSummary": "Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. Apparent power is the product of the root-mean-square of voltage and current.",
5+
"ObsoleteText": "This class is obsolete. Please use ElectricApparentPower instead",
56
"BaseDimensions": {
67
"L": 2,
78
"M": 1,

Common/UnitDefinitions/Capacitance.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"BaseUnit": "Farad",
44
"XmlDocSummary": "Capacitance is the ability of a body to store an electric charge.",
55
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Capacitance",
6+
"ObsoleteText": "This class is obsolete. Please use ElectricCapacitance instead",
67
"BaseDimensions": {
78
"L": -2,
89
"M": -1,

Common/UnitDefinitions/ElectricAdmittance.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"Name": "ElectricAdmittance",
33
"BaseUnit": "Siemens",
44
"XmlDocSummary": "Electric admittance is a measure of how easily a circuit or device will allow a current to flow. It is defined as the inverse of impedance. The SI unit of admittance is the siemens (symbol S).",
5+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Admittance",
6+
"ObsoleteText": "Admittance is a complex number, which is not currently supported by UnitsNet. Please use either ElectricConductance or ElectricSusceptance instead",
57
"BaseDimensions": {
68
"L": -2,
79
"M": -1,
@@ -21,6 +23,19 @@
2123
"Abbreviations": [ "S" ]
2224
}
2325
]
26+
},
27+
{
28+
"SingularName": "Mho",
29+
"PluralName": "Mhos",
30+
"FromUnitToBaseFunc": "{x}",
31+
"FromBaseToUnitFunc": "{x}",
32+
"Prefixes": [ "Nano", "Micro", "Milli", "Kilo" ],
33+
"Localization": [
34+
{
35+
"Culture": "en-US",
36+
"Abbreviations": [ "" ]
37+
}
38+
]
2439
}
2540
]
2641
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"Name": "ElectricApparentEnergy",
3+
"BaseUnit": "VoltampereHour",
4+
"XmlDocSummary": "A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules.",
5+
"BaseDimensions": {
6+
"L": 2,
7+
"M": 1,
8+
"T": -2
9+
},
10+
"Units": [
11+
{
12+
"SingularName": "VoltampereHour",
13+
"PluralName": "VoltampereHours",
14+
"FromUnitToBaseFunc": "{x}",
15+
"FromBaseToUnitFunc": "{x}",
16+
"Prefixes": [ "Kilo", "Mega" ],
17+
"Localization": [
18+
{
19+
"Culture": "en-US",
20+
"Abbreviations": [ "VAh" ]
21+
}
22+
]
23+
}
24+
]
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"Name": "ElectricApparentPower",
3+
"BaseUnit": "Voltampere",
4+
"XmlDocSummary": "Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. It is the product of the root mean square voltage (in volts) and the root mean square current (in amperes).",
5+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/AC_power#Active,_reactive,_apparent,_and_complex_power_in_sinusoidal_steady-state",
6+
"BaseDimensions": {
7+
"L": 2,
8+
"M": 1,
9+
"T": -3
10+
},
11+
"Units": [
12+
{
13+
"SingularName": "Voltampere",
14+
"PluralName": "Voltamperes",
15+
"FromUnitToBaseFunc": "{x}",
16+
"FromBaseToUnitFunc": "{x}",
17+
"Prefixes": [ "Micro", "Milli", "Kilo", "Mega", "Giga" ],
18+
"Localization": [
19+
{
20+
"Culture": "en-US",
21+
"Abbreviations": [ "VA" ]
22+
}
23+
]
24+
}
25+
]
26+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"Name": "ElectricCapacitance",
3+
"BaseUnit": "Farad",
4+
"XmlDocSummary": "Capacitance is the capacity of a material object or device to store electric charge.",
5+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Capacitance",
6+
"BaseDimensions": {
7+
"L": -2,
8+
"M": -1,
9+
"T": 4,
10+
"I": 2
11+
},
12+
"Units": [
13+
{
14+
"SingularName": "Farad",
15+
"PluralName": "Farads",
16+
"BaseUnits": {
17+
"L": "Meter",
18+
"M": "Kilogram",
19+
"T": "Second",
20+
"I": "Ampere"
21+
},
22+
"FromUnitToBaseFunc": "{x}",
23+
"FromBaseToUnitFunc": "{x}",
24+
"Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Kilo", "Mega" ],
25+
"Localization": [
26+
{
27+
"Culture": "en-US",
28+
"Abbreviations": [ "F" ]
29+
}
30+
]
31+
}
32+
]
33+
}

Common/UnitDefinitions/ElectricConductance.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Name": "ElectricConductance",
33
"BaseUnit": "Siemens",
4-
"XmlDocSummary": "The electrical conductance of an electrical conductor is a measure of the easeness to pass an electric current through that conductor.",
4+
"XmlDocSummary": "The electrical conductance of an object is a measure of the ease with which an electric current passes. Its reciprocal quantity is electrical resistance.",
55
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Electrical_resistance_and_conductance",
66
"BaseDimensions": {
77
"L": -2,
@@ -22,6 +22,19 @@
2222
"Abbreviations": [ "S" ]
2323
}
2424
]
25+
},
26+
{
27+
"SingularName": "Mho",
28+
"PluralName": "Mhos",
29+
"FromUnitToBaseFunc": "{x}",
30+
"FromBaseToUnitFunc": "{x}",
31+
"Prefixes": [ "Nano", "Micro", "Milli", "Kilo" ],
32+
"Localization": [
33+
{
34+
"Culture": "en-US",
35+
"Abbreviations": [ "" ]
36+
}
37+
]
2538
}
2639
]
2740
}

Common/UnitDefinitions/ElectricPotential.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"Name": "ElectricPotential",
33
"BaseUnit": "Volt",
44
"XmlDocSummary": "In classical electromagnetism, the electric potential (a scalar quantity denoted by Φ, ΦE or V and also called the electric field potential or the electrostatic potential) at a point is the amount of electric potential energy that a unitary point charge would have when located at that point.",
5+
"XmlDocRemarks": "https://en.wikipedia.org/wiki/Electric_potential",
56
"BaseDimensions": {
67
"L": 2,
78
"M": 1,

Common/UnitDefinitions/ElectricPotentialAc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"Name": "ElectricPotentialAc",
33
"BaseUnit": "VoltAc",
4-
"XmlDocSummary": "The Electric Potential of a system known to use Alternating Current.",
4+
"XmlDocSummary": "If you want to map more parameters into the ElectricPotential class (volts RMS, phase angle, etc.), just use a named tuple.",
5+
"ObsoleteText": "This class is redundant. Please use ElectricPotential instead.",
56
"Units": [
67
{
78
"SingularName": "VoltAc",

0 commit comments

Comments
 (0)