Skip to content

Commit

Permalink
improved documentation, #51
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jun 24, 2017
1 parent 2d98807 commit de7769c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
23 changes: 20 additions & 3 deletions doc/implementation_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,29 @@ This document contains notes that will be helpful to developers and future maint

## Model

This sim uses axon.Property throughout the model and view for storage of properties and
notification of changes.
This sim uses axon.Property in the model for storage of properties to keep track of the Ohm's Law formula. Current is
an axon.DerivedProperty that is dependent on the resistance and voltage properties.

Start by reading the model description model.md

## View

There is only one screen for this simulation. Please see `OhmsLawScreenView.js` for the main launchpoint for the view.
The view consists of three main components.

The view adds batteries around a circuit to demonstrait current. It also has sound.
The `FormulaNode` is responsible for drawing the formula, with symbols that change size proportional their values.

The `ControlPanel` is to the left in the simulation view, and serves as a legend for the formula. It also displays
the exact values of the formula variables, and provides sliders to manipulate them. The `ControlPanel` is divided up into
`SliderUnit`, one for each variable on the left side of the formula (voltage and resistance). An `HSlider` (oriented
vertically) controls the value of the property. In each `SliderUnit`, there is a `Text` for each of the following: the
symbol from the formula, the word it represents, and the value of the variable (with the unit).

The `WireBox` is the graphical representation of Ohm's Law. It is a drawn circuit with illustrated current directional
arrows (`RightAngleArrow`), with Batteries on one side of it for the voltage (`BatteriesView`), and a resistor on the other
side (`ResistorNode`). In the center of the `WireBox`, a readout of the the value of current is displayed (`ReadoutNode`).
Depending on the voltage, more or less AA batteries will show on the top of the wireBox (each represent 1.5 volts).
Depending on the resistance, more or less dots are drawn on the resistor.

The sound is also controlled in the view. Each time a battery is added or taken away, a sound is played.There is also
a button that toggles muting.
11 changes: 6 additions & 5 deletions doc/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

This document describes the model for the Ohm's Law simulation.<br>

The model describes the current of a straight ohmic wire. I is the current through the conductor in units of amperes,
V is the voltage measured across the conductor in units of volts, and R is the resistance of the conductor in units of ohms.
More specifically, Ohm's law states that the R in this relation is constant, independent of the current. This simulation's
model is simple. It represents this formula.
The model represents the current of a circuit.

The Formula is
I= V/R or
Current = Volts / Ohms
Current = Volts / Ohms

`I` is the current through the conductor in units of amperes, `V` is the voltage measured across the conductor in units
of volts, and `R` is the resistance of the conductor in units of ohms. More specifically, Ohm's law states that the R
in this relation is constant, independent of the current. This simulation's model is simple. It represents this formula.

0 comments on commit de7769c

Please sign in to comment.