Metadata-Version: 2.4
Name: rgtlib
Version: 1.1.8
Summary: A Python library for response analysis of graph networks.
Author-email: Dickson Owuor <owuordickson@gmail.com>, 	William Stephenson <willste@umich.edu>, Xiaoming Mao <maox@umich.edu>, Nicholas Kotov <kotov@umich.edu>
Maintainer-email: Dickson Owuor <owuordickson@gmail.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/owuordickson/response-gt
Project-URL: COMPASS, https://compass.engin.umich.edu/
Project-URL: Repository, https://github.com/owuordickson/response-gt.git
Project-URL: Bug Tracker, https://github.com/owuordickson/response-gt/issues
Project-URL: Changelog, https://github.com/owuordickson/response-gt/blob/main/CHANGELOG.md
Keywords: nano-particles,nano-structures,graph-theory
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy==2.2.6
Requires-Dist: pandas==2.3.2
Requires-Dist: scipy==1.16.2
Requires-Dist: pillow~=11.3.0
Requires-Dist: PySide6==6.9.2
Requires-Dist: matplotlib~=3.10.6
Requires-Dist: opencv-python>=4.12.0
Requires-Dist: sgtlib==3.8.5
Requires-Dist: pyamg==5.3.0
Dynamic: license-file

[![Downloads](https://pepy.tech/badge/rgtlib)](https://pepy.tech/project/rgtlib) [![Downloads](https://pepy.tech/badge/rgtlib/week)](https://pepy.tech/project/rgtlib)
![Dependents](https://badgen.net/github/dependents-repo/owuordickson/response-gt/?icon=github)
![Dependents](https://badgen.net/github/license/owuordickson/response-gt/?icon=github)

# ResponseGT
ResponseGT is a software that computes electrical/mechanical flow within a graph network.

## 1. Prerequisites
This software requires Python version 3.12. Install it from [here](https://www.python.org/downloads/).

## 2 Installation

The software can be installed via ```pip``` or ```Conda```.

### 2a. Install via pip

To install the software via ```pip```:

```bash
pip install rgtlib
```

### 2b. Install via Conda

To install the software via ```Conda```:

```bash
conda install -c conda-forge rgtlib
```

## 3. Usage

To run the GUI application, please follow these steps:

* Open a terminal application such as ```CMD``` and execute the following command:

```bash
ResponseGT
```


## 4. Computations

This library provides computational methods for evaluating **AC Response** and **Mechanical Response** on graph-based network models.

### AC Response

The AC Response computation solves the sparse linear system associated with the graph network to obtain the unknown node responses, denoted by (u_b).

Two sparse linear-system solvers are supported:

* **Direct sparse solver:** `scipy.sparse.linalg.spsolve`
* **Algebraic Multigrid (AMG) solver:** `pyamg.smoothed_aggregation_solver`

The solver can be selected using the `use_amg` option.

When `use_amg=True`, the system is solved using a **Smoothed Aggregation Algebraic Multigrid** hierarchy:

```python
import pyamg

ml = pyamg.smoothed_aggregation_solver(q_mat)
ub_list = ml.solve(p_mat, tol=1e-10)
```

When `use_amg=False`, the system is solved using SciPy's direct sparse solver:

```python
from scipy.sparse.linalg import spsolve

ub_list = spsolve(q_mat, p_mat)
```

Here, `q_mat` represents the sparse system matrix and `p_mat` represents the corresponding right-hand side. The resulting `ub_list` contains the computed node responses.

The AMG solver is particularly useful for large sparse graph networks where iterative multilevel methods can provide improved computational scalability compared with a direct sparse factorization.

### Mechanical Response

The library also provides methods for computing the **Mechanical Response** of the graph network. The mechanical computation evaluates the response of the network based on its graph topology and associated mechanical properties.

Both AC and Mechanical Response computations operate directly on the graph representation, allowing the resulting physical responses to be analyzed in relation to the underlying network structure.


## Contributors ✨

Thanks go to these incredible people:

<a href="https://github.com/owuordickson/response-gt/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=owuordickson/response-gt" />
</a>

Made with [contrib.rocks](https://contrib.rocks).
