function calculateRelativeDensity() {
var massSubstance = parseFloat(document.getElementById('massSubstance').value);
var volumeSubstance = parseFloat(document.getElementById('volumeSubstance').value);
var densityReference = parseFloat(document.getElementById('densityReference').value);
var densitySubstanceResultElement = document.getElementById('densitySubstanceResult');
var relativeDensityResultElement = document.getElementById('relativeDensityResult');
// Clear previous results
densitySubstanceResultElement.textContent = ";
relativeDensityResultElement.textContent = ";
if (isNaN(massSubstance) || isNaN(volumeSubstance) || isNaN(densityReference)) {
densitySubstanceResultElement.textContent = 'Please enter valid numbers for all fields.';
return;
}
if (volumeSubstance <= 0) {
densitySubstanceResultElement.textContent = 'Volume of Substance must be greater than zero.';
return;
}
if (densityReference <= 0) {
densitySubstanceResultElement.textContent = 'Density of Reference Substance must be greater than zero.';
return;
}
var densitySubstance = massSubstance / volumeSubstance;
var relativeDensity = densitySubstance / densityReference;
densitySubstanceResultElement.textContent = densitySubstance.toFixed(3) + ' g/cm³';
relativeDensityResultElement.textContent = relativeDensity.toFixed(3);
}
Understanding Relative Density (Specific Gravity)
Relative density, often referred to as specific gravity, is a fundamental concept in physics and engineering. It is a dimensionless quantity that expresses the ratio of the density of a substance to the density of a reference substance. For liquids and solids, the reference substance is almost always water, typically at 4°C, where its density is approximately 1 gram per cubic centimeter (g/cm³) or 1000 kilograms per cubic meter (kg/m³).
What Does Relative Density Tell Us?
Relative density provides valuable insights into the properties of materials:
Buoyancy: A substance with a relative density less than 1 will float in the reference substance, while one with a relative density greater than 1 will sink. For example, ice (relative density ~0.92) floats in water.
Material Identification: Each pure substance has a unique relative density, making it a useful property for identifying unknown materials or verifying the purity of known ones.
Quality Control: In industries, relative density is used to monitor the concentration of solutions, the quality of petroleum products, or the ripeness of fruits.
Fluid Dynamics: It plays a critical role in calculations involving fluid flow, pressure, and the stability of objects submerged in or floating on liquids.
How is Relative Density Calculated?
The calculation of relative density involves two primary steps:
Determine the Density of the Substance: This is calculated by dividing the mass of the substance by its volume.
Density of Substance = Mass of Substance / Volume of Substance
Calculate the Relative Density: This is achieved by dividing the calculated density of the substance by the density of the chosen reference substance.
Relative Density = Density of Substance / Density of Reference Substance
Since relative density is a ratio of two densities, the units cancel out, resulting in a unitless number.
Using the Relative Density Calculator
Our Relative Density Calculator simplifies the process of finding this important value. Follow these steps:
Mass of Substance (g): Input the measured mass of your substance in grams.
Volume of Substance (cm³): Enter the measured volume of your substance in cubic centimeters.
Density of Reference Substance (g/cm³): Provide the density of your chosen reference substance. For most standard applications, water at 4°C (1.00 g/cm³) is used. You can adjust this value if you are using a different reference fluid or water at a different temperature.
Click the "Calculate Relative Density" button. The calculator will instantly display both the calculated density of your substance and its relative density.
Examples of Relative Density for Common Materials
Water: 1.00 (when water is the reference)
Ice: ~0.92
Aluminum: ~2.70
Iron: ~7.87
Gold: ~19.30
Wood (Pine): ~0.40 – 0.60
Gasoline: ~0.72 – 0.78
These examples illustrate how relative density helps us compare the "heaviness" of different materials relative to a standard.