{"id":25347614,"url":"https://github.com/who-else-but-arjun/pyspyce-cs","last_synced_at":"2026-04-20T10:32:59.130Z","repository":{"id":264515675,"uuid":"893571444","full_name":"who-else-but-arjun/pyspyce-cs","owner":"who-else-but-arjun","description":"Circuit Simulator for R, L, C components and AC/DC voltage and current sources built using python as a part of EE204 circuit theory course project. ","archived":false,"fork":false,"pushed_at":"2025-01-09T08:32:25.000Z","size":790,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-07T20:52:41.274Z","etag":null,"topics":["circuit-simulator","numpy","python","streamlit","sympy"],"latest_commit_sha":null,"homepage":"https://pyspyce.streamlit.app/ ","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/who-else-but-arjun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-24T19:27:01.000Z","updated_at":"2025-01-09T08:32:29.000Z","dependencies_parsed_at":"2024-11-24T20:30:18.927Z","dependency_job_id":"952c1752-bd57-441a-a757-a169e5eb9be7","html_url":"https://github.com/who-else-but-arjun/pyspyce-cs","commit_stats":null,"previous_names":["who-else-but-arjun/circuit-simulator-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/who-else-but-arjun/pyspyce-cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/who-else-but-arjun%2Fpyspyce-cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/who-else-but-arjun%2Fpyspyce-cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/who-else-but-arjun%2Fpyspyce-cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/who-else-but-arjun%2Fpyspyce-cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/who-else-but-arjun","download_url":"https://codeload.github.com/who-else-but-arjun/pyspyce-cs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/who-else-but-arjun%2Fpyspyce-cs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32043049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuit-simulator","numpy","python","streamlit","sympy"],"created_at":"2025-02-14T14:57:32.661Z","updated_at":"2026-04-20T10:32:59.113Z","avatar_url":"https://github.com/who-else-but-arjun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# PySpyce : Circuit Simulator\n\n## Overview\n\nPySpyce is a Python-based circuit Simulator tool designed to model and analyze electrical (RLC) circuits interactively. \nIt supports both time-domain and frequency-domain analyses using numerical and symbolic computation.\n\n### Key Features:\n- Add and analyze RLC components (Resistors, Inductors, Capacitors) and sources (Voltage, Current).\n- Solve circuit equations using Kirchhoff's Current Law (KCL).\n- Perform Laplace transform-based frequency-domain analysis.\n- Generate time-domain responses using inverse Laplace transforms.\n- Visualize circuits as dynamic graphs.\n- Interactive plots for time and frequency responses.\n\n---\n\n## Libraries Used\n\nThe following Python libraries are required to run the Circuit Simulator:\n\n- **Streamlit**: For building the interactive web interface.\n- **Sympy**: For symbolic mathematics and solving circuit equations.\n- **NumPy**: For numerical computations and data handling.\n- **Matplotlib**: For plotting and visualizing the circuit diagrams.\n- **Plotly**: For interactive time-domain and frequency-domain plots.\n- **NetworkX**: For graph-based visualization of circuit diagrams.\n\n---\n\n## Code Explanation\n\n### `calculations.py`\nThis file contains the core class `CircuitSimulator`, which implements the computational logic. \nIt includes methods for:\n\n- **Component Management**:\n  - `add_component()`: Adds RLC components and sources to the circuit.\n- **Symbolic Equation Setup**:\n  - `setup_node_variables()`: Creates symbolic variables for voltages and currents.\n  - `build_equations()`: Constructs equations using KCL and component relations.\n- **Solution and Analysis**:\n  - `solve_circuit()`: Solves the equations for node voltages and branch currents.\n  - `get_time_domain_response()`: Calculates time-domain responses via inverse Laplace transforms.\n  - `get_frequency_response()`: Computes frequency response (magnitude and phase) over a given range.\n- **Visualization**:\n  - `create_circuit_visualization()`: Generates dynamic circuit diagrams.\n\n### `circuit-simulator.py`\nThis file provides the interactive user interface built with Streamlit. \nUsers can:\n- Add circuit components via dropdowns and numeric inputs.\n- Visualize the circuit dynamically.\n- Analyze circuit responses (time and frequency domains) through interactive plots.\n- Manage and clear components as needed.\n\n---\n\n## How to Run\n\n### Prerequisites\n\n1. Install Python 3.8+.\n2. Install the required libraries using pip:\n   ```bash\n   pip install streamlit sympy numpy matplotlib plotly networkx\n   ```\n\n### Steps\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd \u003crepository-folder\u003e\n   ```\n\n2. Run the simulator using Streamlit:\n   ```bash\n   streamlit run circuit-simulator.py\n   ```\n\n3. Open the provided local URL (usually `http://localhost:8501`) in a web browser.\n\n---\n\n## Project Flow\n\n1. **Add Components**:\n   - Specify the type (Resistor, Capacitor, Inductor, Voltage Source, or Current Source).\n   - Enter values and node connections.\n   - For AC sources, specify additional parameters (amplitude, frequency, waveform type).\n2. **Analyze Circuit**:\n   - Solve the circuit equations to compute node voltages and branch currents.\n   - View time-domain and frequency-domain plots.\n3. **Visualize Circuit**:\n   - Explore the dynamically generated circuit graph.\n4. **Iterate**:\n   - Modify components and analyze again.\n\n---\n\n## Example\n\n### Input:\n- Add components:\n  - Resistor (100 Ω) between Node 0 and Node 1.\n  - Voltage Source (10 V) between Node 1 and Node 0.\n\n### Output:\n- Voltage at Node 1: 10 V.\n- Time-domain and frequency-domain responses plotted interactively.\n\n---\n\n## Future Improvements\n\n- Support for additional component types (e.g., transformers, diodes).\n- Enhanced visualization with 3D circuit layouts.\n- Exportable reports for circuit analyses.\n\n---\n\n## Contributors\n\n- **[Arjun Verma]** - 230102125\n- **[Subhashree Sahoo]** - 230102122\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwho-else-but-arjun%2Fpyspyce-cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwho-else-but-arjun%2Fpyspyce-cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwho-else-but-arjun%2Fpyspyce-cs/lists"}