flownetpy package

Submodules

flownetpy.flownetwork module

A module for flow network simulations

class flownetpy.flownetwork.FlowNetwork(graph, inputs, weight=None)[source]

Bases: networkx.classes.graph.Graph

A class to describe a flow network.

A flow network is a graph with two properties:
  1. Some amount of flow (called input) enters/leaves through its each node.
  2. Each edge transports some flow (called current).

How the input flows distribute themselves into currents is determined by a flowmodel.

steady_flows(**kwargs)[source]

Returns the steady state flows.

Keyword Arguments:
 Whatever is required by the flows method of the flowmodel.
Returns:
  • F (dictionary) – A set of steady state flows in the network in form of a dictionary; s.t. F[(u,v)] == flow from u to v
  • infodict (dictionary) – Additional conditions that lead to these flows.

Note

Depending on the flowmodel, the returned flows may not be unique.

flownetpy.kuramotonetwork module

class flownetpy.kuramotonetwork.KuramotoNetwork(graph, inputs, weight=None)[source]

Bases: flownetpy.flownetwork.FlowNetwork

steady_flows(initguess=None, extra_output=True)[source]

Computes the steady state flows.

Parameters:
  • self – A selfwork object
  • initguess – Initial conditions
  • extra_output – boolean
Returns:

A dictionary

d = {edge1 : flow1, edge2 : flow2,...}

If extra_output=True, returns another dictionary

data = {initguess: the_initial_condition, ‘thetas’: steady_state_thetas, ‘omega’: winding_vector}

flownetpy.kuramotonetwork.odeint(func, x0, t=None, args=None, jac=None)[source]

Integrate an ode for time array t

flownetpy.linearflownetwork module

class flownetpy.linearflownetwork.LinearFlowNetwork(graph, inputs, weight=None)[source]

Bases: flownetpy.flownetwork.FlowNetwork

steady_flows()[source]
The fixed points are given by:
sum_j (p_j-p_i)

flownetpy.tools module

class flownetpy.tools.FlowDict[source]

Bases: dict

This is a custom dictionary class with tuples as keys. If self[(u, v)] does not exist, then self[(u, v)] is initialized with -self[(v, u)]

Module contents

class flownetpy.FlowNetwork(graph, inputs, weight=None)

Bases: networkx.classes.graph.Graph

A class to describe a flow network.

A flow network is a graph with two properties:
  1. Some amount of flow (called input) enters/leaves through its each node.
  2. Each edge transports some flow (called current).

How the input flows distribute themselves into currents is determined by a flowmodel.

steady_flows(**kwargs)

Returns the steady state flows.

Keyword Arguments:
 Whatever is required by the flows method of the flowmodel.
Returns:
  • F (dictionary) – A set of steady state flows in the network in form of a dictionary; s.t. F[(u,v)] == flow from u to v
  • infodict (dictionary) – Additional conditions that lead to these flows.

Note

Depending on the flowmodel, the returned flows may not be unique.

class flownetpy.KuramotoNetwork(graph, inputs, weight=None)

Bases: flownetpy.flownetwork.FlowNetwork

steady_flows(initguess=None, extra_output=True)

Computes the steady state flows.

Parameters:
  • self – A selfwork object
  • initguess – Initial conditions
  • extra_output – boolean
Returns:

A dictionary

d = {edge1 : flow1, edge2 : flow2,...}

If extra_output=True, returns another dictionary

data = {initguess: the_initial_condition, ‘thetas’: steady_state_thetas, ‘omega’: winding_vector}

class flownetpy.LinearFlowNetwork(graph, inputs, weight=None)

Bases: flownetpy.flownetwork.FlowNetwork

steady_flows()
The fixed points are given by:
sum_j (p_j-p_i)

flownetpy

A python package for flow network simulations

Navigation


Related Topics

Fork me on GitHub