pyrc.core.components.resistor#
- class Resistor(resistance: float | int | Expr = nan)#
Bases:
ObjectWithPorts,SymbolMixin(Thermal) resistor element of an RC network.
This is the base class of all Resistors and heat and mass transfer/transport elements calculating the resistance by their own.
- Parameters:
resistance (float | int | Expr) – The (thermal) resistance of the
Resistorin K/W.
- __init__(resistance: float | int | Expr = nan)#
(Thermal) resistor element of an RC network.
This is the base class of all Resistors and heat and mass transfer/transport elements calculating the resistance by their own.
- Parameters:
resistance (float | int | Expr) – The (thermal) resistance of the
Resistorin K/W.
- property all_resistors_inbetween: list[Resistor]#
Returns all resistors between both connected
TemperatureNodes including self.- Returns:
All Resistors that form the equivalent resistor between both connected
TemperatureNodes.- Return type:
list[Resistor]
- connect(neighbour, direction: tuple | list | ndarray | Any = None, node_direction_points_to=None)#
Overloading for further checking and warning.
- Parameters:
neighbour
direction
node_direction_points_to
- property direct_connected_node_templates#
- property equivalent_resistance: float64 | float | int | Expr#
Returns the equivalent resistance from one node to the other.
This considers both serial and parallel Resistors between the same Nodes.
- Returns:
The equivalent resistance from one node to the other.
- Return type:
np.float64
- property equivalent_resistance_symbol#
- get_connected(asking_node: ObjectWithPorts) list[ObjectWithPorts]#
Returns the neighbour that isn’t the asking one.
- Parameters:
asking_node (ObjectWithPorts) – The asking Node. The method will return the other neighbour of
self.- Returns:
The other neighbour of
self.- Return type:
- get_connected_node(asking_node: TemperatureNode | Resistor) TemperatureNode#
Returns the connected TemperatureNode that isn’t the asking one. It is routed through all connected Resistors to the TemperatureNode.
- Parameters:
asking_node (TemperatureNode | Resistor) – The asking Node. The method will return the other node connected (over other
Resistors) to self.- Returns:
The other node connected to
self.- Return type:
- heat_flux(asking_node: Capacitor) float#
Returns the accumulated heat flux of this node that is transferred into the
asking_node.- Parameters:
asking_node (Capacitor) – The Node asking for the heat flux. If the result is positive that heat flows into the asking_node.
- Returns:
The heat flux flowing into the asking_node in W.
- Return type:
float
- property nodes#
Returns both connected nodes, no matter, if other resistors are between them.
- Returns:
The Nodes in a list.
- Return type:
list
- classmethod reset_counter()#
- property resistance: float | int | Expr#
- resistor_counter = 1501#
- property symbols: list#
Returns a list of all sympy.symbols of the object, except time dependent symbols.
Must be in the same order as self.values.
- Returns:
The list of sympy.symbols.
- Return type:
list
- property values: list#
Returns a list of all values of all object symbols, except of time dependent symbols.
Must be in the same order as self.symbols.
- Returns:
The list of sympy.symbols.
- Return type:
list
- parallel_equivalent_resistance(start_resistor: Resistor, ignore_resistor: Resistor = None) float64#
Calculates the equivalent resistance of the connected Resistors.
It also checks if the connected Resistors are connected to other Resistors in serial and consider this, too.
This only works, if no other parallel resistors occur. But this should be okay, because this doesn’t make any sense thermo-physically.
- Parameters:
start_resistor (Resistor) – The start Resistor, where in one “direction” parallel resistors are connected to (can also be just one).
ignore_resistor (Resistor, optional) – If given this Resistor is excluded from the neighbours list of start_resistor. This is needed to determine some kind of “direction” and only calculate the equivalent resistance for the Resistors that are actually parallel.
- Returns:
The equivalent resistance of the connected Resistors without the resistance of the start_resistor.
- Return type:
np.float64