{"id":21224595,"url":"https://github.com/aradzie/jecs","last_synced_at":"2025-10-26T10:33:43.016Z","repository":{"id":37581637,"uuid":"401294289","full_name":"aradzie/jecs","owner":"aradzie","description":"Electronic circuit simulator written in JavaScript.","archived":false,"fork":false,"pushed_at":"2025-02-28T11:36:07.000Z","size":19505,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T17:25:21.399Z","etag":null,"topics":["circuit","circuit-simulator","electronics","simulator","spice"],"latest_commit_sha":null,"homepage":"https://aradzie.github.io/jecs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aradzie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-08-30T09:54:25.000Z","updated_at":"2025-02-28T11:35:42.000Z","dependencies_parsed_at":"2025-02-05T13:33:11.506Z","dependency_job_id":"1e9f8b25-e6be-40a1-84d6-55aa530ade7d","html_url":"https://github.com/aradzie/jecs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aradzie%2Fjecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aradzie%2Fjecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aradzie%2Fjecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aradzie%2Fjecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aradzie","download_url":"https://codeload.github.com/aradzie/jecs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253024606,"owners_count":21842399,"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","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","circuit-simulator","electronics","simulator","spice"],"created_at":"2024-11-20T22:59:11.292Z","updated_at":"2025-10-26T10:33:37.973Z","avatar_url":"https://github.com/aradzie.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Electronic Circuit Simulator\n\n**jecs** is an electronic circuit simulator written in TypeScript.\n\nIt supports AC, DC and transient analyses.\n\n## Example\n\nCreate a netlist file `netlist.txt`:\n\n```text\nVac:Vin pow gnd V=1 f=1k\nR:R1 pow vout R=1k\nC:C1 vout gnd C=$C1\nR:R2 vout gnd R=1k\n.tr\n  stopTime=3m timeStep=1u\n  .sweep $C1 type=\"lin\" start=1u stop=3u points=3\n```\n\nand run the simulator in the terminal:\n\n```shell\njecs --verbose netlist.txt\n```\n\nThe simulator will produce a dataset file `netlist.data`.\n\n## Example\n\nThe following code:\n\n```typescript\n// Create an empty circuit.\nconst circuit = new Circuit();\n\n// Allocate circuit nodes.\nconst GND = circuit.groundNode;\nconst N1 = circuit.makeNode(\"N1\");\nconst N2 = circuit.makeNode(\"N2\");\n\n// Create devices.\nconst V1 = new Vdc(\"V1\");\nconst R1 = new Resistor(\"R1\");\nconst D1 = new Diode(\"D1\");\n\n// Connect devices in the circuit.\ncircuit.connect(V1, [N1, GND]);\ncircuit.connect(R1, [N1, N2]);\ncircuit.connect(D1, [N2, GND]);\n\n// Set device properties.\nV1.props.set(\"V\", 10);\nR1.props.set(\"R\", 1000);\nD1.props.set(\"temp\", 26.85);\n\n// Perform DC analysis, compute node voltages and branch currents.\nconst analysis = new DcAnalysis();\nanalysis.props.set(\"maxIter\", 10);\nanalysis.props.set(\"abstol\", 1e-12);\nanalysis.props.set(\"vntol\", 1e-6);\nanalysis.props.set(\"reltol\", 1e-3);\nanalysis.run(circuit);\n\n// Print the operating points.\nconsole.log(dumpCircuit(circuit));\n```\n\nprints the following result:\n\n```typescript\n[\n  \"V(N1)=10V\", // voltage at node N1\n  \"V(N2)=712.407mV\", // voltage at node N2\n  \"V1{V=10V,I=-9.288mA,P=-92.876mW}\", // voltage source output params\n  \"R1{V=9.288V,I=9.288mA,P=86.259mW}\", // resistor output params\n  \"D1{V=712.407mV,I=9.288mA,P=6.617mW}\", // diode output params\n];\n```\n\n## Virtual Curve Tracer\n\nThe following non-linear device I/V curves were obtained from the simulator.\n\n### Diode I/V Curve\n\n![Diode I/V curve](examples/iv-diode.svg)\n\n### BJT I/V Curve\n\n![BJT I/V curve](examples/iv-bjt.svg)\n\n### MOSFET I/V Curve\n\n![MOSFET I/V curve](examples/iv-mosfet.svg)\n\n### JFET I/V Curve\n\n![JFET I/V curve](examples/iv-jfet.svg)\n\n### BJT Amplifier I/V Curve\n\n![BJT Amplifier I/V curve](examples/amp-bjt.svg)\n\n### MOSFET Amplifier I/V Curve\n\n![MOSFET Amplifier I/V curve](examples/amp-mosfet.svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faradzie%2Fjecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faradzie%2Fjecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faradzie%2Fjecs/lists"}