respice


Namerespice JSON
Version 0.3.10 PyPI version JSON
download
home_pagehttps://gitlab.com/Makman2/respice
SummaryFlexible and easy to use non-linear transient electric circuit simulator.
upload_time2024-10-04 10:13:06
maintainerNone
docs_urlNone
authorMischa Krüger
requires_python>=3.7
licenseMIT
keywords electronics circuit simulation non-linear transient steady-state time-domain
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            respice
=======

Flexible and easy to use non-linear transient electric circuit simulator.

Install
-------

.. code:: bash

   pip3 install respice

Usage
-----

Create your circuit and simulate it!

.. code:: python

   from respice.analysis import Circuit
   from respice.components import CurrentSourceDC, R, C

   # Define components for our circuit.
   R1 = R(100)
   R2 = R(200)
   C3 = C(10e-6)
   R4 = R(200)
   R5 = R(100)
   Isrc = CurrentSourceDC(0.1)

   # Construct the circuit. All circuits are just
   # Digraphs allowing multiple edges. On each edge
   # one component.
   wheatstone_bridge = Circuit()
   wheatstone_bridge.add(R1, 0, 1)
   wheatstone_bridge.add(R2, 0, 2)
   wheatstone_bridge.add(C3, 1, 2)
   wheatstone_bridge.add(R4, 1, 3)
   wheatstone_bridge.add(R5, 2, 3)
   wheatstone_bridge.add(Isrc, 3, 0)

   # Simulate! From t1 = 0ms to t2 = 5ms with 100 steps.
   simulation = wheatstone_bridge.simulate(0, 0.005, 100)

The results are stored in the returned object and can be easily accessed
via ``simulation.v(component)``, ``simulation.i(component)`` or ``simulation.p(component)``.
Those contain the voltages, currents and powers respectively for each time step
as a list. The time steps can be accessed with ``simulation.t()``.

All simulations are asynchronous. Accessing results early may only give partial
results. Use ``simulation.wait()`` to wait until the result is ready.

Results can be immediately plotted.
For plotting, ``plotly`` is required.

.. code:: python

   from respice.examples import RC

   # Define an example RC circuit. The package respice.examples
   # contains a few!
   rc = RC(100, 100e-6, 10)  # 100Ohm, 100uF, 10V
   simulation = rc.simulate(0, 0.1, 100)
   simulation.plot()

The plot function will wait automatically until the result is finished. Live-plotting
is not supported yet.

More simulations can be found on the `snippets page <https://gitlab.com/Makman2/respice/-/snippets>`_.

Supports
--------

- **MNA - Modified Nodal Analysis**

  This is the algorithm employed by this software. So it’s easily
  possible to handle voltages as well as currents.

- **Transient non-linear steady-state analysis**

  Find quickly periodic steady-state solutions of a circuit that appear
  when the circuit transients have settled.

- **Multi-terminal components**

  Components with more than just two terminals can be handled easily.
  Whether each sub-branch of them is a current- or voltage-branch, or
  whether they are current- or voltage-driven.

- **Mutual coupling**

  Usually required by multi-terminal components, mutual coupling is
  easily implementable. Each sub-branch in a component is automatically
  receiving the voltages and currents of all other branches comprising
  the component.

Documentation
-------------

More details and explanations are available in the documentation.

Documentation is generated via Sphinx. To build the documentation:

.. code:: bash

   pip3 install -r requirements.txt -r docs-requirements.txt
   make html

The index file can then be opened with your favorite browser at ``build/html/index.html``.

Documentation is also available `online <https://Makman2.gitlab.io/respice>`_.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/Makman2/respice",
    "name": "respice",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "electronics circuit simulation non-linear transient steady-state time-domain",
    "author": "Mischa Kr\u00fcger",
    "author_email": "makmanx64@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b7/38/7e07ef0187d881feaab94360d4510fbc3c708596345753242d47975f5148/respice-0.3.10.tar.gz",
    "platform": "any",
    "description": "respice\n=======\n\nFlexible and easy to use non-linear transient electric circuit simulator.\n\nInstall\n-------\n\n.. code:: bash\n\n   pip3 install respice\n\nUsage\n-----\n\nCreate your circuit and simulate it!\n\n.. code:: python\n\n   from respice.analysis import Circuit\n   from respice.components import CurrentSourceDC, R, C\n\n   # Define components for our circuit.\n   R1 = R(100)\n   R2 = R(200)\n   C3 = C(10e-6)\n   R4 = R(200)\n   R5 = R(100)\n   Isrc = CurrentSourceDC(0.1)\n\n   # Construct the circuit. All circuits are just\n   # Digraphs allowing multiple edges. On each edge\n   # one component.\n   wheatstone_bridge = Circuit()\n   wheatstone_bridge.add(R1, 0, 1)\n   wheatstone_bridge.add(R2, 0, 2)\n   wheatstone_bridge.add(C3, 1, 2)\n   wheatstone_bridge.add(R4, 1, 3)\n   wheatstone_bridge.add(R5, 2, 3)\n   wheatstone_bridge.add(Isrc, 3, 0)\n\n   # Simulate! From t1 = 0ms to t2 = 5ms with 100 steps.\n   simulation = wheatstone_bridge.simulate(0, 0.005, 100)\n\nThe results are stored in the returned object and can be easily accessed\nvia ``simulation.v(component)``, ``simulation.i(component)`` or ``simulation.p(component)``.\nThose contain the voltages, currents and powers respectively for each time step\nas a list. The time steps can be accessed with ``simulation.t()``.\n\nAll simulations are asynchronous. Accessing results early may only give partial\nresults. Use ``simulation.wait()`` to wait until the result is ready.\n\nResults can be immediately plotted.\nFor plotting, ``plotly`` is required.\n\n.. code:: python\n\n   from respice.examples import RC\n\n   # Define an example RC circuit. The package respice.examples\n   # contains a few!\n   rc = RC(100, 100e-6, 10)  # 100Ohm, 100uF, 10V\n   simulation = rc.simulate(0, 0.1, 100)\n   simulation.plot()\n\nThe plot function will wait automatically until the result is finished. Live-plotting\nis not supported yet.\n\nMore simulations can be found on the `snippets page <https://gitlab.com/Makman2/respice/-/snippets>`_.\n\nSupports\n--------\n\n- **MNA - Modified Nodal Analysis**\n\n  This is the algorithm employed by this software. So it\u2019s easily\n  possible to handle voltages as well as currents.\n\n- **Transient non-linear steady-state analysis**\n\n  Find quickly periodic steady-state solutions of a circuit that appear\n  when the circuit transients have settled.\n\n- **Multi-terminal components**\n\n  Components with more than just two terminals can be handled easily.\n  Whether each sub-branch of them is a current- or voltage-branch, or\n  whether they are current- or voltage-driven.\n\n- **Mutual coupling**\n\n  Usually required by multi-terminal components, mutual coupling is\n  easily implementable. Each sub-branch in a component is automatically\n  receiving the voltages and currents of all other branches comprising\n  the component.\n\nDocumentation\n-------------\n\nMore details and explanations are available in the documentation.\n\nDocumentation is generated via Sphinx. To build the documentation:\n\n.. code:: bash\n\n   pip3 install -r requirements.txt -r docs-requirements.txt\n   make html\n\nThe index file can then be opened with your favorite browser at ``build/html/index.html``.\n\nDocumentation is also available `online <https://Makman2.gitlab.io/respice>`_.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Flexible and easy to use non-linear transient electric circuit simulator.",
    "version": "0.3.10",
    "project_urls": {
        "Bug Tracker": "https://gitlab.com/Makman2/respice/issues",
        "Homepage": "https://gitlab.com/Makman2/respice",
        "Source Code": "https://gitlab.com/Makman2/respice/-/tree/master"
    },
    "split_keywords": [
        "electronics",
        "circuit",
        "simulation",
        "non-linear",
        "transient",
        "steady-state",
        "time-domain"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "142a4e35557b613ebc867a23375ae51fbad8e17d55107b798d6aece159c733a4",
                "md5": "b1a57191399503f34f03f911cd3a719d",
                "sha256": "0b2ddcb57a0cabebc74441f10ce809f1313c8fc4f8c0ae5512cf5b24e74da0ea"
            },
            "downloads": -1,
            "filename": "respice-0.3.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1a57191399503f34f03f911cd3a719d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 83443,
            "upload_time": "2024-10-04T10:13:04",
            "upload_time_iso_8601": "2024-10-04T10:13:04.203394Z",
            "url": "https://files.pythonhosted.org/packages/14/2a/4e35557b613ebc867a23375ae51fbad8e17d55107b798d6aece159c733a4/respice-0.3.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b7387e07ef0187d881feaab94360d4510fbc3c708596345753242d47975f5148",
                "md5": "2e20b00e50bec63024af12635c8b274f",
                "sha256": "8ad94ae697baf5c4828224b18d47418826b07d84250cf3dc9d3cfabfd9ae7609"
            },
            "downloads": -1,
            "filename": "respice-0.3.10.tar.gz",
            "has_sig": false,
            "md5_digest": "2e20b00e50bec63024af12635c8b274f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 55458,
            "upload_time": "2024-10-04T10:13:06",
            "upload_time_iso_8601": "2024-10-04T10:13:06.968012Z",
            "url": "https://files.pythonhosted.org/packages/b7/38/7e07ef0187d881feaab94360d4510fbc3c708596345753242d47975f5148/respice-0.3.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-04 10:13:06",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "Makman2",
    "gitlab_project": "respice",
    "lcname": "respice"
}
        
Elapsed time: 0.34119s