Git Product home page Git Product logo

circuit-simulator's Introduction

Circuit Simulator

Build Status David David

An electronic circuit simulator inspired by Paul Falstad's excellent circuit simulator.

Vision

A visual, fully interactive circuit simulator in your browser.

// TODO

  • Visible component values
  • Deletable components
  • Editable components values
  • Transient analysis
  • Capacitors
  • Inductors
  • Time-varying sources (e.g. sine wave voltage source)
  • Default circuit on startup
  • Multiple component selection
  • Oscilloscopes
  • Helpful error messaging (for voltage source loops etc.)
  • Non-linear analysis
  • Diodes, transistors & valves
  • Save, load and share circuits
  • AC analysis

Play

Want to play around?

git clone [email protected]:circuitsim/circuit-simulator.git
cd circuit-simulator
npm install
npm run dev

Open localhost:8080.

circuit-simulator's People

Contributors

thomwright avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circuit-simulator's Issues

LED

It would be nice to be able to connect a LED light.

LOGIC GATES

Great job,Would be more effective to add logic gates and more components.

Need to tell users how to create components

Possible implementation:

  • If no components have been created
  • User selects component type from sidebar
  • Moves mouse over canvas
  • A message appears in the bottom right saying "Click and drag on the canvas to create a(n) ${typeID}"

Add new hover detection system

The previous system, using a higher-order component and react-art's built-in mouseOver events, wasn't fit for purpose because it doesn't allow enough control when there are multiple overlapping components. We need this control to implement #12 to decide which connector to drag.

  • Remove BoundingBox React component.
  • Add functions to each component type
  • On begin function of each loop iteration, if mouse moved, determine which component is being hovered over.

Each circuit component type should have a getBoundingBox function:

  • connectors :: [Vector] -> BoundingBox

BoundingBox will have a contains function:

  • point :: Vector -> boolean

We can then iterate over each view to determine if the mouse cursor is hovering over one (or more) circuit component.

We will then need to decide which single component is being hovered, in the case of overlapping boxes.

New org logo

Need a nicely designed org logo, not a crappy screenshot.

Components should be movable after creation

Should be able to:

  • click and drag a component
  • click and drag a connector

Hover highlighting an element should:

  • show circles at the connectors
  • change the cursor to a hand

Prereqs:

Hello, and how can I help?

I see your in the beginning phases of this project and there is not much to see, but what I do see I like. This is the most active and current effort to create such a thing on the web so I thought this is where I would like to offer my help. When I first started programming many years ago I dreamed that one day I could create something like this. It seemed like a very far off goal, one I had l had long since forgotten about until recently while getting deep into DSP/Audio programming on the web.

One of my goals is to be able to emulate analog circuits which will produce a signal you can hear and interact with as well as visualize.

Where are you at with this project and where could you use the most input and/or assistance?

Voltage should be visualised

A couple of possibilities:

  • colour gradients along wires/components, as in Falstad's sim
  • numbers and mini-scopes, as in everycircuit

Disconnected Ground causes noticeable numerical errors

image

Ground connected:

CurrentSource 1
2Resistor.js:83 Resistor 0.9997000999660113
Resistor.js:83 Resistor 0.9996001399520164
Ground.js:110 Ground [0.0003998600479836467]
CurrentSource.js:102 CurrentSource 1

Ground disconnected:

CurrentSource 1
Resistor.js:83 Resistor 1.0000000000000002
2Resistor.js:83 Resistor 0.9999000099990002
Ground.js:110 Ground [-0]

Probably due to the fact that we're connecting disconnected circuits to ground with a high-value resistor. Time to consider #27 more seriously?

Multiple circuits could work independently

Currently multiple disconnected circuits are connected together and treated as one for analysis. We could treat them all as separate circuits and analyse them independently. This would mean that problems with one circuit wouldn't affect the others.

Split reducers up to manage parts of the state

E.g. modeReducer to manage the mode. Action creators could dispatch multiple actions to affect different parts of the state, rather than a single reducer per action creator handling everything.

Show component details on hover

  • Semi-highlight on hover, full highlight when selected (currently full highlights on hover, no highlight when selected)
  • Use 'pointer' mouse icon when hovering to indicate component can be clicked (or moved... possibly confusing)

Build broken

Looks like Snap is caching installed NPM modules or something?

Branding

  • favicon etc.
  • links to GitHub/website etc.

Separate the concepts of 'connectors' and 'drag points'

A component can have:

  • any number of connectors
  • 2 dragPoints

connectors are used for the simulation to detect which components are connected together. Should they be rendered as blobs?

dragPoints are used to create/move components. These are rendered on hover.

Re-license

Consider using a more appropriate license.

I want all modifications/derivatives to be open source, should I GPL this?

Should handle multiple disconnected circuits

Find each connected graph in circuit. For each connected graph, connect one node to ground with high-value resistor (in circuit equation only).

nodes = array of: -1 for unconnected, nodeID for connected to node
findConnectedNodes(nodeID) - use BFS/DFS

  • for each unconnected node: findConnectedNodes(groundID)
  • for each unique value in nodes, connect node to ground with high-value resistor (in circuit equation only)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.