dilution.calculate_dilution
dilution.calculate_dilution(stock_concentration, stock_volume, final_volume)
Calculate the final concentration of a solution after dilution.
This function applies the standard laboratory dilution equation:
C1 * V1 = C2 * V2
where:
- C₁ = stock_concentration
- V₁ = stock_volume
- C₂ = final_concentration
- V₂ = final_volume (returned value)
Parameters
| stock_concentration |
float |
Concentration of the original stock solution. Must be positive. |
required |
| stock_volume |
float |
Volume of stock solution used. Must be positive and less than or equal to final_volume. |
required |
| final_volume |
float |
Final total volume after dilution. Must be positive. |
required |
Returns
|
float |
Final concentration of the diluted solution. |
Raises
|
TypeError |
If any input is not numeric. |
|
ValueError |
If any input is non-positive or stock_volume > final_volume. |
Examples
>>> from biomathhh.dilution import calculate_dilution
>>> calculate_dilution(5.0, 1.0, 5.0)
1.0
>>> calculate_dilution(8.0, 10.0, 40.0)
2.0