Skip to content

Commit

Permalink
Normalize companion elements, see #531
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Nov 6, 2019
1 parent 22dfbb5 commit 4b541a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/model/DynamicCircuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ define( require => {
// we need to be able to get the current for this component
// in series, so current is same through both companion components
currentCompanions.push( {
element: inductor,
element: dynamicInductor,

// TODO(sign-error): check sign, this was converted from battery to resistor
getValueForSolution: solution => -solution.getCurrentForResistor( resistor )
Expand Down Expand Up @@ -480,7 +480,7 @@ define( require => {
// TODO: the comparisons are asymmetrical, how can they both work?
const companion = _.find( this.currentCompanions, c => c.element === element ||
c.element.capacitor === element ||
c.element === element.inductor );
c.element.inductor === element );

if ( companion ) {
return companion.getValueForSolution( this.mnaSolution );
Expand Down

0 comments on commit 4b541a4

Please sign in to comment.