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.1.tar.gz (49.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: cimulate-0.2.1.tar.gz
  • Upload date:
  • Size: 49.1 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.1.tar.gz
Algorithm Hash digest
SHA256 2e8efd80b088185e37d5d070814d34a2aca82569c0ffac68609a39b41895521b
MD5 2a3ad52a340aebb03308428895b95b48
BLAKE2b-256 9a30bb0047936f434928ac1480541e6aee4f0a3504c0948dd0d8a2a1d2d527c3

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