Skip to content

debsankha/flownetpy

Repository files navigation

A python package to study flow networks

Testing status PyPI version Documentation Status coverage http://img.shields.io/:license-gpl3-blue.svg?style=flat-square)]

This package contains tools to simulate a flow according to user-definable flowmodels (e.g. linear Poiseuillie flow) on any graph.

This is a module for simulating flow networks.

Usage

>>> import flownetpy as fn
>>>
>>> C=nx.cycle_graph(4)
>>> I=np.array([1,-1,1,-1])
>>> KK=fn.LinearFlowNetwork(C,I, weight=1)
>>>
>>> KK.steady_flows()
{(0, 1): 0.49999999999999994,
(0, 3): 0.49999999999999956,
(1, 2): -0.5000000000000006,
(2, 3): 0.5000000000000001}