Skip to main content

Easy electrical circuit simulations in Python

Project description

cimulate

cimulate is a Rust crate for modeling electrical components and circuits, featuring Python bindings for easy integration. Combine components to create complex circuits and perform simulations with built-in electrical elements.

Installation

Install the Python package via pip:

$ pip install cimulate

For Rust usage, include it in your Cargo.toml:

[dependencies]
cimulate = "0.2"  # Replace with the current version

Example

from cimulate import Resistor, Capacitor, Inductor
import numpy as np

# Create components
r = Resistor(100)  # 100 Ohms
c = Capacitor(1e-6)  # 1 µF
l = Inductor(1e-3)  # 1 mH

# Combine components in series (+) and parallel (/)
circuit = r + c / l

# You can calculate the impedance (remember to use angular frequency)
frequency = np.geomspace(0.001, 1000, 1000)  # 1 mHz to 1 kHz
omega = 2 * np.pi * frequency
impedance = [circuit.impedance(w) for w in omega]

# You can even simulate voltages with a driving current
time = np.linspace(0, 60, 1000)
current = time / 6
voltage = circuit.voltage(current)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cimulate-0.2.0.tar.gz (48.9 kB view details)

Uploaded Source

File details

Details for the file cimulate-0.2.0.tar.gz.

File metadata

  • Download URL: cimulate-0.2.0.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.6

File hashes

Hashes for cimulate-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b7873d9492a29b9115eea83d555e3def8e885b6236f67d6b4c30cef4a4577ae5
MD5 6f68237f7b3c719c0acce48cf1041b7a
BLAKE2b-256 7b5801b01c84e6beb6b719a5bfa7c214a3d9be8eb5ae3596307a26dfb50d56ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page