Coder Social home page Coder Social logo

simplecircuitsimulation's Introduction

Simple circuit simulation using JavaScript

You can test this circuit simulation here.

This is a simple circuit simulation designed for science classes using JavaScript and HTML5. To accommodate a wide range of students including Primary school students, a very simple user interface was used. You can modify the circuit by dragging and dropping the bulb or the wire, or toggling the switch. For example, you can drag the bulb or the wire above the series circuit and replace the bulb in the circuit or you can remove the bulb in the circuit by dragging it out. You can turn the switch on or off by clicking the switch. The battery cannot be changed. If you want to see, the voltage(V), current(A), and wattage(W), you can click the button to show the information. For simplicity, the resistance of the light bulb is assumed to be invariant regardless of power consumption. In reality, the resistance varies by the power consumption. This circuit simulation is also designed for mobile devices and can be controlled using touch interface. For a reliable operation inside the circuit simulation box, multi-touch is disabled inside the box. If you want to zoom in or out, you need to use the finger jesture outside the simulation box. This code was originally written as a Java Applet for a web page in 1998. However, most web browsers have droppped supports the NPAPI plugin architecture in 2018, and therefore no longer supports Java Applet technology. To make the code work again with a web browser, it was converted from Java to JavaScript and HTML5 tags.

Series Circuit

This is a demonstration of a simple series circuit. You can create a series circuit with a combination of 1, 2, 3 ohm resistors and a wire. The light generated by the light bulb is proportional to the power consumption. If you replace two bulbs with a wire and use 1 ohm light bulb, the maximum brightness (9 Watt) can be obtained. If you replace all light bulbs with 3 ohm light bulbs, you will get the lowest brightness (0.33 Watt).

series_circuit

Parallel Circuit

This is a demonstration of a simple parallel circuit. The behaviour of parallel circuits are not always easy to predict. For example, if you replace a 1 ohm light bulb of the parallel part of the circuit with a 3 ohm light bulb, the power consumption of the other light bulb of the parallel circuit will increase.

parallel_circuit

simplecircuitsimulation's People

Contributors

jhpark16 avatar

Stargazers

mePy2 avatar

Watchers

James Cloos avatar  avatar

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.