Tonicity adjustment: mass of agent to reach a stated isotonic reference
form_tonicity_adjustment
Works out the mass of an adjusting agent that brings a solution to the isotonic reference you state.
- Runs
- On the server
- Level
- Checked against a reference: exact arithmetic: Python fractions on the recorded equations, written before the engine; a second implementation in Python by a separate agent of the same model family
What it is
Returns the mass of an adjusting agent that brings a solution to the isotonic reference you state. Use when adjusting a formulation by the sodium chloride equivalent or freezing-point depression method, with your table values. Not for the osmolarity of a solution: use `form_osmolarity`; not for a plain % w/v solution: use `calc_percent_solution`. You state the reference or target, E and ΔT_f (commonly 9 g/L sodium chloride, 0.9 % w/v, or 0.52 K); none is defaulted; depressions in K; a solution already above the reference is refused; iso-osmotic by calculation, not a tonicity test.
Field: Formulation and stability.
What it does
You give
method(required): sodium_chloride_equivalent: each component's E against isotonicReference; freezing_point_depression: each component's ΔT_f at 1 % w/v against targetDepression. Required, never assumed; the reply has the same shape either way.volume(required): The final volume of the solution being adjusted.massUnit(required): The unit of the agent mass returned.components(required): The solution's other solutes, one entry each. An empty list is plain water: the agent alone brings it to the reference. At most fifty.isotonicReference: sodium_chloride_equivalent only: the sodium chloride concentration you take as isotonic, as a mass concentration. You state it; commonly 9 g/L sodium chloride (0.9 % w/v). None is built in. Optional.targetDepression: freezing_point_depression only: the freezing-point depression you take as isotonic, in K, below 273.15 K. You state it; commonly 0.52 K. A depression of 0.52 °C is 0.52 K; state it in K. Must be below 273.15 K. Optional.
and 2 more, listed below
No request is recorded for this tool.
Limits
- Research arithmetic for formulation and stability on values you supply, including every coefficient and constant; not a compounding, dosing, clinical, release, expiry-dating or regulatory authority.
- Formulation arithmetic on values you supply, including every dissociation number, osmotic coefficient, sodium chloride equivalent and freezing-point depression.
- A calculated osmolarity is not a measured osmolality, and a calculated isotonic amount is not a tonicity test.
- Research and education software: not for diagnosis or treatment decisions, and not a compounding or release authority.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
It will not answer when
- the components alone exceed the caller's reference (Σ cᵢ·Eᵢ > c_ref, or Σ wᵢ·ΔT_f,i > ΔT_target): no amount of agent lowers it, and a negative mass is never returned; the reason names which sum exceeded which reference, without numbers (no partial in this version).
- a depression is given in degC: a depression is a temperature difference in K; a depression of 0.52 °C is 0.52 K; give it in K.
- a depression is given as °C: the kit refuses that spelling before the unit is read; a depression of 0.52 °C is 0.52 K; give it in K.
- targetDepression outside above 0 K.
Every input, with its units8 inputs
method(required): sodium_chloride_equivalent: each component's E against isotonicReference; freezing_point_depression: each component's ΔT_f at 1 % w/v against targetDepression. Required, never assumed; the reply has the same shape either way.volume(required): The final volume of the solution being adjusted.massUnit(required): The unit of the agent mass returned.components(required): The solution's other solutes, one entry each. An empty list is plain water: the agent alone brings it to the reference. At most fifty.isotonicReference: sodium_chloride_equivalent only: the sodium chloride concentration you take as isotonic, as a mass concentration. You state it; commonly 9 g/L sodium chloride (0.9 % w/v). None is built in. Optional.targetDepression: freezing_point_depression only: the freezing-point depression you take as isotonic, in K, below 273.15 K. You state it; commonly 0.52 K. A depression of 0.52 °C is 0.52 K; state it in K. Must be below 273.15 K. Optional.adjustingAgentEquivalent: sodium_chloride_equivalent only: E of the agent you add, in grams of sodium chloride per gram of agent, which you state (1 for sodium chloride itself). Optional.adjustingAgentOnePercentDepression: freezing_point_depression only: the freezing-point depression of a 1 % w/v (10 g/L) solution of the agent you add, in K, below 273.15 K, from your own table. Never assumed, for sodium chloride included. Must be below 273.15 K. Optional.
Every refusal, with its code4 refusals
| Code | When |
|---|---|
ALREADY_HYPERTONIC | the components alone exceed the caller's reference (Σ cᵢ·Eᵢ > c_ref, or Σ wᵢ·ΔT_f,i > ΔT_target): no amount of agent lowers it, and a negative mass is never returned; the reason names which sum exceeded which reference, without numbers (no partial in this version). |
TEMPERATURE_DIFFERENCE_IN_K | a depression is given in degC: a depression is a temperature difference in K; a depression of 0.52 °C is 0.52 K; give it in K. |
UNIT_SPELLING | a depression is given as °C: the kit refuses that spelling before the unit is read; a depression of 0.52 °C is 0.52 K; give it in K. |
NOT_POSITIVE | targetDepression outside above 0 K. |
The calculation
The method's equations, constants and worked example.
Equation 1
| Symbol | Meaning |
|---|---|
c_agent | mass concentration of the adjusting agent to add, g/L |
c_ref | isotonic reference, as sodium chloride (the caller's), g/L |
cᵢ | mass concentration of component i, g/L |
Eᵢ | sodium chloride equivalent of component i: grams of sodium chloride osmotically equivalent to one gram of it |
E_agent | sodium chloride equivalent of the adjusting agent |
Σᵢ cᵢ·Eᵢ | sodium chloride equivalent the components already supply, returned as equivalentPresent (zero with no components), g/L |
V | volume of the solution, in litres (1 mL = 0.001 L), L |
m_agent | mass of the adjusting agent to add, returned in the massUnit asked (1 g = 1000 mg), g |
Source 1.
Equation 2
w_agent (% w/v) = (ΔT_target − Σᵢ wᵢ·ΔT_f,i(1 %)) / ΔT_f,agent(1 %), wᵢ = cᵢ/(10 g/L)
| Symbol | Meaning |
|---|---|
w_agent | concentration of the adjusting agent in % w/v (grams per 100 mL), % |
ΔT_target | target freezing-point depression (the caller's), K |
wᵢ | concentration of component i in % w/v (grams per 100 mL): its mass concentration in g/L divided by 10 g/L, % |
cᵢ | mass concentration of component i, as stated, g/L |
Σᵢ wᵢ·ΔT_f,i(1 %) | freezing-point depression the components already supply, returned as depressionPresent (zero with no components), K |
ΔT_f,i(1 %) | freezing-point depression of a one percent w/v solution of component i, K |
ΔT_f,agent(1 %) | freezing-point depression of a one percent w/v solution of the adjusting agent, K |
c_agent | mass concentration of the adjusting agent to add, g/L |
V | volume of the solution, in litres (1 mL = 0.001 L), L |
m_agent | mass of the adjusting agent to add, returned in the massUnit asked (1 g = 1000 mg), g |
Source 1.
| Constant | Value | From |
|---|---|---|
grams per 100 mL (1 % w/v = 10 g/L), the convention of the depression tables % w/v | 10 g/L | Source 1 |
A definition, not a model: the equation states what the quantity means. A different convention gives a different number.
Worked example
Worked example: one case of form-tonicity@2.0.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.
Inputs
- method = sodium_chloride_equivalent
- volume = 100 mL
- massUnit = g
- isotonicReference = 9 g/L
- adjustingAgentEquivalent = 1
- components[0].concentration = 10 g/L
- components[0].sodiumChlorideEquivalent = 0.13
Steps
- present = 1.3 g/L, from components[0].concentration, components[0].sodiumChlorideEquivalent; by equation 1; gives equivalentPresent.
- need = 7.7 g/L, from isotonicReference, present; by equation 1.
- agentConcentration = 7.7 g/L, from need, adjustingAgentEquivalent; by equation 1; gives agentConcentration.
- agentMass = 0.77 g, from agentConcentration, volume; by equation 1; gives agentMass.
The working, as the case writes it:
the hand calculation of form-tonicity-1#equivalent-sodium-chloride, copied with its worked block (worked by hand by the raising builder, 14 November 2026)
Answer
equivalentPresent = 1.3 g/L
agentConcentration = 7.7 g/L
agentMass = 0.77 g
Where these values came from: our own exact-arithmetic script and a hand-worked case; the second implementation's run(arguments).
At build the tool returned this answer within the tolerance the file states: Masses, concentrations, equivalents and depressions relative 1e-12; the exactly-isotonic cases' agentMass and agentConcentration (ids ending exactly-isotonic), and the two no-components cases' present sum, are structural exact zeros, compared exactly; no other expected value is near zero (the just-below cases' smallest is 0.000172… g): the near-zero floor (absolute 1e-312 below 1e-300, unit 1) is nominal; statuses, codes and units exact; where one path carries more than one unit, or a logarithmic unit, absolute at the relative value times the smallest nonzero magnitude under it (the largest, for a logarithm).
Sources
Umar AK, Butarbutar M, Sriwidodo S, Wathoni N, Kahar Method: A Novel Calculation Method of Tonicity Adjustment, J Pharm Bioallied Sci 11(Suppl 4):S635–S649 (2019)
Used for: Mass of an adjusting agent that brings a solution to a stated isotonic reference, by the sodium chloride equivalent or the freezing-point depression method. At: equation 3, W = 0.9 % − Σ(E₁% × C%), NaCl as the agent; division by E_agent derived here; equation 2, W% = (0.52 − α)/b, b defined for NaCl at 1 %; another agent's b derived here; equation 2: W the required salt content in g/100 mL.
Read in full, 10 November 2026
How it is checked
- Level
Checked against a reference.
- Checked against
Our own exact-arithmetic script and a hand-worked case.
- Cases
No case set is linked to this version.
- Not checked
The E and ΔT_f values (the caller's tables): they vary with concentration, and table values hold at the concentrations tabulated; permeant solutes (iso-osmotic is not isotonic where membranes pass a solute); the methods' primary texts (USP ⟨785⟩, ⟨1160⟩, Remington), unread; linearity at high concentration; measured tonicity.
Changes to its methods1 change
- 14 November 2026, form-tonicity@2.0.0: In 2.0.0 the shortfall and the amount already present are the exact values rounded once; the agent concentration adds one rounding (equivalent method) or two (depression method), and the mass one more, as the record now states. Seven near-tie cases of stored reference values move in their last bits (a major), so that file is retired and stored reference values replaces it. The record also states how a depression given in degC or °C is refused.