{"id":19787133,"url":"https://github.com/sahilbansal17/ac_circuit_solver","last_synced_at":"2025-09-18T01:31:44.875Z","repository":{"id":108867206,"uuid":"123854654","full_name":"sahilbansal17/AC_Circuit_Solver","owner":"sahilbansal17","description":"Given the netlist, this program draws an AC circuit and finds the current/voltage values.","archived":false,"fork":false,"pushed_at":"2018-03-31T18:50:03.000Z","size":1138,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-25T16:32:14.233Z","etag":null,"topics":["ac-circuits","circuit-simulator","circuit-solver","cpp","lexical-analysis","yacc"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/sahilbansal17.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":"2018-03-05T02:39:58.000Z","updated_at":"2025-04-13T22:50:44.000Z","dependencies_parsed_at":"2023-03-15T13:30:34.826Z","dependency_job_id":null,"html_url":"https://github.com/sahilbansal17/AC_Circuit_Solver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sahilbansal17/AC_Circuit_Solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilbansal17%2FAC_Circuit_Solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilbansal17%2FAC_Circuit_Solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilbansal17%2FAC_Circuit_Solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilbansal17%2FAC_Circuit_Solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sahilbansal17","download_url":"https://codeload.github.com/sahilbansal17/AC_Circuit_Solver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilbansal17%2FAC_Circuit_Solver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275695701,"owners_count":25511349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"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":["ac-circuits","circuit-simulator","circuit-solver","cpp","lexical-analysis","yacc"],"created_at":"2024-11-12T06:21:16.525Z","updated_at":"2025-09-18T01:31:44.164Z","avatar_url":"https://github.com/sahilbansal17.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AC_Circuit_Solver\nGiven the netlist, this program draws an AC circuit and finds the current/voltage values.\n\n## How to run \n1. `make execute`\n2. `./ac_circuit_solver input.cir output1.svg output2.txt`\n\nCommand 2 runs the program taking NETLIST as input from **input.cir** and generates **output1.svg.html** as output image and **output2.txt** with the voltages and currents after solving the circuit. \n\n## Code structure\nThe entire code is in the **src/** directory and is structured in the following way:\n\n\u003e 1. *ac_circuit_solver.cpp*\n\u003e \u003e This is the main file for the entire project.\n\n\u003e 2. *draw.h* and *draw.cpp*\n\u003e \u003e They contain the main function to draw the circuit.\n\n\u003e 3. *parse.h*\n\u003e \u003e It contains the element and source structures and their vectors obtained after parsing the input netlist. \n\n\u003e 4. *parseCircuit.y*\n\u003e \u003e It is the yacc file used while parsing.\n\n\u003e 5. *scanCircuit.l*\n\u003e \u003e It is the lex file used while scanning. \n\n\u003e 6. *svg.cpp* and *svg.h*\n\u003e \u003e They contain the svg functions used for drawing individual elements and implement onClick events on text to get an alert box showing statistics of the element when clicked.\n  \n\u003e 7. **Eigen/** directory\n\u003e \u003e It is the C++ library used for generating and solving matrices. \n\n\n## Testing \nA testing script **testScript.sh** has also been written to run many cases simultaneously. It can be modified as per the usage.\n\nAll the test cases used for testing the working are included in the **Public_cases** folder. \n\n## Restrictions on Input Netlist \n\nThere are some restrictions kept in the netlist format:\n\n1. The net can have only an non-negative value as name. **eg.** *NET 0*, *Net 1*.\n2. The elements can have only non-negative value as name. **eg.** *R5*, *V0*.\n3. The only units allowed to specify values are **K(Kilo)**, **N(Nano)** and **M(Milli)**. This is deliberately done for the purpose of easy error reporting in case units are mismatched.\n4. For resistor, only the value has to be supplied **eg.** *10K* would mean *10 kilo ohms* whereas for capacitor and inductor, *F* and *H* need to be written after unit. **eg.** *10NF*. \n5. **The frequency unit allowed for voltage and current sources is only KHz.**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahilbansal17%2Fac_circuit_solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahilbansal17%2Fac_circuit_solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahilbansal17%2Fac_circuit_solver/lists"}