pyrc.core.components.resistor#

class Resistor(resistance=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 | np.number) – The (thermal) resistance of the Resistor in K/W.

__init__(resistance=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 | np.number) – The (thermal) resistance of the Resistor in 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)#

Add the given object/neighbour to the self.neighbours list.

The neighbour itself will connect self to its neighbours list. E.g.: If node2 should be connected to node1, node2’s neighbours list appends self.

The direction is a possibility to set the direction between two connected nodes manually. It is used for connected BoundaryCondition s and Node s. The direction is set for the neighbour. The

Parameters:
  • neighbour (ObjectWithPorts) – The neighbour to connect to. It will connect self to itself. This is the Node the manual direction is set on!

  • direction (tuple | list | np.ndarray, optional) – If not None, a direction is set manually to node_direction_points_at. Either none or both node_direction_points_at and direction must be passed.

  • node_direction_points_to (TemperatureNode, optional) – If not None, this is the node to which the direction points at (looking from neighbour). Either none or both node_direction_points_at and direction must be passed. Must be a TemperatureNode.

property direct_connected_node_templates#
property equivalent_resistance: float64#

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: Capacitor | Node | Resistor) list[TemperatureNode | Resistor]#

Returns the neighbour that isn’t the asking one.

Parameters:

asking_node (Capacitor | Node) – The asking Node. The method will return the other neighbour of self.

Returns:

The other neighbour of self.

Return type:

TemperatureNode

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 (Capacitor | 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:

TemperatureNode

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 | np.nan#
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