orbitx/physics/electrofunctions.py
def component_resistances(y: EngineeringState) -> np.ndarray:
    """Returns an array of each component's effective resistance.
    If a component is not connected to the bus, or it has been set
    to 0% capacity, it will have infinite resistance."""

    # This is a per-component list of scalars.
    # A value of 1 means a component is 'on' and at 100% capacity.
    # A value of 0 means a component is 'off', or at 0% capacity.
    # A value of 1.2 means a component is 'on' and at 120% capacity.
    # Values can be in the range [0, 1], as well as greater than 1.
    component_capacities = y.components.Connected() * y.components.Capacities()

    component_resistances_assuming_full_capacity = (
        electroconstants.BASE_COMPONENT_RESISTANCES +
        electroconstants.ALPHA_RESIST_GAIN * y.components.Temperatures() *
        electroconstants.BASE_COMPONENT_RESISTANCES
    )

    return np.divide(
        component_resistances_assuming_full_capacity,
        component_capacities,

        # If we would divide by zero, instead just skip that step and return Inf.
        # We don't want to divide by zero here, because we've configured np.seterr
        # to raise an exception on divide-by-zero.
        # https://stackoverflow.com/a/37977222/1333978 for this divide-by-zero guarding code.
        where=(component_capacities != 0), out=np.full_like(component_capacities, np.inf)
    )
Returns an array of each component's effective resistance.
    If a component is not connected to the bus, or it has been set
    to 0% capacity, it will have infinite resistance.
Returns an array of each component's effective resistance.
If a component is not connected to the bus, or it has been set
to 0% capacity, it will have infinite resistance.
Returns an array of each component ' s effective resistance . If a component is not connected to the bus or it has been set to 0% capacity it will have infinite resistance .
def component_resistances(y: EngineeringState) -> np.ndarray:
    component_capacities = y.components.Connected() * y.components.Capacities()
    component_resistances_assuming_full_capacity = (
        electroconstants.BASE_COMPONENT_RESISTANCES +
        electroconstants.ALPHA_RESIST_GAIN * y.components.Temperatures() *
        electroconstants.BASE_COMPONENT_RESISTANCES
    )
    return np.divide(
        component_resistances_assuming_full_capacity,
        component_capacities,
        where=(component_capacities != 0), out=np.full_like(component_capacities, np.inf)
    )
def component_resistances ( y : EngineeringState ) -> np . ndarray : component_capacities = y . components . Connected ( ) * y . components . Capacities ( ) component_resistances_assuming_full_capacity = ( electroconstants . BASE_COMPONENT_RESISTANCES + electroconstants . ALPHA_RESIST_GAIN * y . components . Temperatures ( ) * electroconstants . BASE_COMPONENT_RESISTANCES ) return np . divide ( component_resistances_assuming_full_capacity , component_capacities , where = ( component_capacities != 0 ) , out = np . full_like ( component_capacities , np . inf ) )
Returns an array of each component's effective resistance.
Returns an array of each component ' s effective resistance .
"""Returns an array of each component's effective resistance.
    If a component is not connected to the bus, or it has been set
    to 0% capacity, it will have infinite resistance.""" # This is a per-component list of scalars. # A value of 1 means a component is 'on' and at 100% capacity. # A value of 0 means a component is 'off', or at 0% capacity. # A value of 1.2 means a component is 'on' and at 120% capacity. # Values can be in the range [0, 1], as well as greater than 1. # If we would divide by zero, instead just skip that step and return Inf. # We don't want to divide by zero here, because we've configured np.seterr # to raise an exception on divide-by-zero. # https://stackoverflow.com/a/37977222/1333978 for this divide-by-zero guarding code.
y
EngineeringState