diff --git a/js/CCKCConstants.ts b/js/CCKCConstants.ts index 74e55f47..318f6ead 100644 --- a/js/CCKCConstants.ts +++ b/js/CCKCConstants.ts @@ -72,7 +72,8 @@ const CCKCConstants = { // R = rho * L / A. Resistance = resistivity * Length / cross sectional area. // https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity says copper has rho=1.68E-8 Ohm * m // According to http://www.sengpielaudio.com/calculator-cross-section.htm AWG Wire Gauge of 20 has 0.52mm^2 = 5.2e-7m^2 - DEFAULT_RESISTIVITY: CCKCQueryParameters.wireResistivity, // Ohm * m + MIN_WIRE_RESISTIVITY: CCKCQueryParameters.wireResistivity, // Ohm * m + MAX_WIRE_RESISTIVITY: 0.0168, // Ohm * m WIRE_CROSS_SECTIONAL_AREA: 5E-4, // meters squared diff --git a/js/model/Circuit.ts b/js/model/Circuit.ts index b33a8a8b..d0b016db 100644 --- a/js/model/Circuit.ts +++ b/js/model/Circuit.ts @@ -13,6 +13,7 @@ import NumberProperty from '../../../axon/js/NumberProperty.js'; import createObservableArray, { ObservableArray } from '../../../axon/js/createObservableArray.js'; import Property from '../../../axon/js/Property.js'; import dotRandom from '../../../dot/js/dotRandom.js'; +import Range from '../../../dot/js/Range.js'; import Vector2 from '../../../dot/js/Vector2.js'; import PhetioGroup from '../../../tandem/js/PhetioGroup.js'; import NullableIO from '../../../tandem/js/types/NullableIO.js'; @@ -160,8 +161,9 @@ export default class Circuit { this.includeACElements = options.includeACElements; this.includeLabElements = options.includeLabElements; this.blackBoxStudy = options.blackBoxStudy; - this.wireResistivityProperty = new NumberProperty( CCKCConstants.DEFAULT_RESISTIVITY, { - tandem: tandem.parentTandem!.createTandem( 'wireResistivityProperty' ) + this.wireResistivityProperty = new NumberProperty( CCKCConstants.MIN_WIRE_RESISTIVITY, { + tandem: tandem.parentTandem!.createTandem( 'wireResistivityProperty' ), + range: new Range( CCKCConstants.MIN_WIRE_RESISTIVITY, CCKCConstants.MAX_WIRE_RESISTIVITY ) } ); this.sourceResistanceProperty = new NumberProperty( CCKCConstants.DEFAULT_BATTERY_RESISTANCE, { diff --git a/js/view/WireResistivityControl.ts b/js/view/WireResistivityControl.ts index 8774537d..d120c5fb 100644 --- a/js/view/WireResistivityControl.ts +++ b/js/view/WireResistivityControl.ts @@ -23,9 +23,6 @@ const wireResistivityStringProperty = CircuitConstructionKitCommonStrings.wireRe // constants const TICK_LABEL_TEXT_OPTIONS = { fontSize: 12, maxWidth: 45 }; -// Chosen so that current through battery+long wire+long wire+resistor would match prior version, see https://github.com/phetsims/circuit-construction-kit-common/issues/553 -const MAX_RESISTIVITY = 0.0168; - export default class WireResistivityControl extends VBox { /** @@ -39,8 +36,8 @@ export default class WireResistivityControl extends VBox { const titleNode = new Text( wireResistivityStringProperty, titleConfig ); const slider = new HSlider( wireResistivityProperty, new Range( - CCKCConstants.DEFAULT_RESISTIVITY, - MAX_RESISTIVITY // large enough so that max resistance in a 9v battery slows to a good rate + CCKCConstants.MIN_WIRE_RESISTIVITY, + CCKCConstants.MAX_WIRE_RESISTIVITY // large enough so that max resistance in a 9v battery slows to a good rate ), { trackSize: CCKCConstants.SLIDER_TRACK_SIZE, thumbSize: CCKCConstants.THUMB_SIZE, @@ -49,7 +46,7 @@ export default class WireResistivityControl extends VBox { } ); slider.addMajorTick( 0, new Text( tinyStringProperty, TICK_LABEL_TEXT_OPTIONS ) ); - slider.addMajorTick( MAX_RESISTIVITY, new Text( lotsStringProperty, TICK_LABEL_TEXT_OPTIONS ) ); + slider.addMajorTick( CCKCConstants.MAX_WIRE_RESISTIVITY, new Text( lotsStringProperty, TICK_LABEL_TEXT_OPTIONS ) ); super( { children: [ titleNode, slider ],