Skip to content

Commit

Permalink
note the mass and radius of heavy and light particles in phetioDocume…
Browse files Browse the repository at this point in the history
…ntation, #30
  • Loading branch information
pixelzoom committed May 1, 2024
1 parent 58116e4 commit 5da1aa0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 4 additions & 0 deletions js/common/GasPropertiesConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ const GasPropertiesConstants = {
HEAVY_PARTICLES_RANGE: new RangeWithValue( 0, 1000, 0 ),
LIGHT_PARTICLES_RANGE: new RangeWithValue( 0, 1000, 0 ),

// mass
HEAVY_PARTICLES_MASS: 28, // AMU, equivalent to N2 (nitrogen), rounded to the closest integer
LIGHT_PARTICLES_MASS: 4, // AMU, equivalent to He (helium), rounded to the closest integer

// radii
HEAVY_PARTICLES_RADIUS: 125, // pm
LIGHT_PARTICLES_RADIUS: 87.5, // pm
Expand Down
7 changes: 2 additions & 5 deletions js/common/model/HeavyParticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@ import Particle from './Particle.js';

export default class HeavyParticle extends Particle {

// equivalent to N2 (nitrogen), in AMU, rounded to the closest integer
public static readonly MASS = 28;

public constructor() {
super( {

// ParticleOptions
mass: HeavyParticle.MASS,
radius: GasPropertiesConstants.HEAVY_PARTICLES_RADIUS, // pm
mass: GasPropertiesConstants.HEAVY_PARTICLES_MASS,
radius: GasPropertiesConstants.HEAVY_PARTICLES_RADIUS,
colorProperty: GasPropertiesColors.heavyParticleColorProperty,
highlightColorProperty: GasPropertiesColors.heavyParticleHighlightColorProperty
} );
Expand Down
6 changes: 2 additions & 4 deletions js/common/model/LightParticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ import Particle from './Particle.js';

export default class LightParticle extends Particle {

public static readonly MASS = 4; // equivalent to He (helium), in AMU, rounded to the closest integer

public constructor() {
super( {

// ParticleOptions
mass: LightParticle.MASS,
radius: GasPropertiesConstants.LIGHT_PARTICLES_RADIUS, // pm
mass: GasPropertiesConstants.LIGHT_PARTICLES_MASS,
radius: GasPropertiesConstants.LIGHT_PARTICLES_RADIUS,
colorProperty: GasPropertiesColors.lightParticleColorProperty,
highlightColorProperty: GasPropertiesColors.lightParticleHighlightColorProperty
} );
Expand Down
6 changes: 4 additions & 2 deletions js/common/model/ParticleSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,17 @@ export default class ParticleSystem {
numberType: 'Integer',
range: GasPropertiesConstants.HEAVY_PARTICLES_RANGE,
tandem: tandem.createTandem( 'numberOfHeavyParticlesProperty' ),
phetioDocumentation: `Number of heavy particles (mass = ${HeavyParticle.MASS} AMU) in the container.`,
phetioDocumentation: 'Number of heavy particles in the container. ' +
`(mass = ${GasPropertiesConstants.HEAVY_PARTICLES_MASS} AMU, radius = ${GasPropertiesConstants.HEAVY_PARTICLES_RADIUS} pm)`,
hasListenerOrderDependencies: true // TODO: https://github.com/phetsims/gas-properties/issues/186
} );

this.numberOfLightParticlesProperty = new NumberProperty( GasPropertiesConstants.LIGHT_PARTICLES_RANGE.defaultValue, {
numberType: 'Integer',
range: GasPropertiesConstants.LIGHT_PARTICLES_RANGE,
tandem: tandem.createTandem( 'numberOfLightParticlesProperty' ),
phetioDocumentation: `Number of light particles (mass = ${LightParticle.MASS} AMU) in the container.`,
phetioDocumentation: 'Number of light particles in the container. ' +
`(mass = ${GasPropertiesConstants.LIGHT_PARTICLES_MASS} AMU, radius = ${GasPropertiesConstants.LIGHT_PARTICLES_RADIUS} pm)`,
hasListenerOrderDependencies: true // TODO: https://github.com/phetsims/gas-properties/issues/186
} );

Expand Down

0 comments on commit 5da1aa0

Please sign in to comment.