The power system is the system that connects and grants functionality through electricity to all aspect of the station.
It’s primary purpose is to be a link between objects which produce power and objects which consume power. It is additionally be responsible for the events related to power, such as when a component's power is lost or when it is reconnected. At any time a power consuming or producing object will be able to easily access the electrical information such as available watt’s (or joules per second).
The physics implementation has been partially inspired by a popular simulation game, Oxygen Not Included (ONI). You can find a brief description of the power system in ONI here.
The power system will be described electrically with two components, Watts and Joules. The relationship between them is:
In other words, 60W = 60J/s. Watts and joules are different physically speaking, a joule is a measure of energy (or work) used when doing something, and a watt is a measure of how many joules you are using over time (Joules / s). If your microwave says it uses 900 watts then it is consuming 900 joules per second to heat up your microwave dinner. Therefore we can describe electrical relationships really simply and effectively, for example a 60 watt light bulb operated for an hour will use 60J * 3600s = 360kJof energy.
The power system will consist of any amount of circuits which allow the connection of producers and consumers, the circuit will be made up of continuous wires and likely Area Power Controllers (APC’s), an APC is a special object which connects to a wire on one side and allows for the wireless connection of energy consuming components to the electrical circuit.
The electrical wires will be able to be damaged, repaired, cut, and reconnected. If a wire is damaged too much it will become cut, a player or script can also cut wires. When a wire is cut or reconnected the circuit/s will be updated and refreshed. All objects on a circuit are instantaneously and logically connected to one another, the entire circuit is one logical object and has some given wattage based on its producers and consumers.
The station will be made of several circuits which logically separate objects based on geography and power consumption, circuits can be subdivided through objects such as transformers or other objects. A transformer will allow for a high wattage circuit to be subdivided to a low wattage circuit (i.e. a 2000W circuit connected to several 500W circuits)
Circuits allow objects to be logically connected together, a circuit does not necessarily need to be powered, it’s main function is connecting objects together across the station. For example a circuit could connect a collection of solar panels together to a Solar Panel Controller (SPC), the solar panels themselves do not actually generate watts, however by being connected to the SPC via a circuit the SPC can then itself output watts onto another circuit.
Circuits will be physically connected together via wires, however they can also be connected together logically if it’s required, for example the lights in a room might be apart of a circuit in the room but do not have literal wires reaching to them, and are instead connected “through the air” to a junction box which is physically connected to wires. (The actual implementation of deciding what objects should connect to what APCs, and how it should interact with the player is not a part of the immediate scope of this proposal, only the immediate functionality of the APC is being considered here.)
Switches are one example of an object which can be used to separate two circuits, the object itself only allows each circuit to be connected to one another when it is engaged. For this reason it must be easy to logically connect circuits together via links such as switches.
A producer is responsible for putting some wattage of power onto the circuit it is directly connected to, an example of a producer is a Solar Panel Controller (SPC), which itself will be connected to multiple solar panels. However in the actual implementation the solar panels themselves will be the energy producers. But for the sake of the example the SPC could produce a different wattage depending on how many solar panels it is connected to, and the direction of the solar panels.
Objects will be able to quickly and easily query information about its circuit, such as the amount of connected solar panels through a function such as: connectedCircuit.GetAllOfType<SolarPanel>()
A consumer will have some wattage of power it requires to operate, for example a light might need 10W of power to operate, and if it doesn’t receive more than 10J/s of energy it will fail and start flickering, then after a moment it will turn off completely until it receives power again.
Consumers on a circuit share the energy on the circuit, if a circuit has 100W of power available, each object on that circuit will reduce the available watts, if the circuit has two lights which each consume 10W then the energy available decreases to 80W (80J/s).
A battery is a special object, it is both a consumer and a producer in one. When the battery's connected circuit has excess power, for example a 100W circuit with 80W free, it will consume the excess power up to its wattage intake. A battery for example may be able to consume 200W of energy, but in this case it only has 80W available. Unlike other consumers the battery does not fail when its actual energy intake is under its required intake (200W). (In this case it's less of a required intake and more of a maximum intake.) The battery then converts the watts into energy which is stored internally, for example a battery might store 10kJ of energy.
When the intake wattage becomes negative, for example maybe the power goes off and our two lights are now on a circuit with -20W, the battery switches from a consumer to a producer, it uses its internally stored 10kJ of energy and puts it onto the circuit. The battery will output as much power per second as is required to keep all the components on the circuit powered, if the circuit requires 20W the battery will output 20W, at this rate the battery is consuming 20J/s of its stored energy and will use its entire 10kJ of storage in 1000 seconds.