brimfile.physics v1.7.0rc1

 1from __future__ import annotations
 2
 3from math import sin, radians, pi
 4# refractive index of water (dimensionless)
 5refractive_index_water = 1.333
 6
 7def Brillouin_shift_water(wavelength_nm: float, temperature_C: float, scattering_angle_deg: float) -> float:
 8    """
 9    Calculate the Brillouin shift for water at a given temperature and wavelength.
10
11    Args:
12        wavelength (float): Wavelength in nanometers.
13        temperature (float): Temperature in degrees Celsius. Valid range 20 to 40 °C.
14        scattering_angle (float): Scattering angle in degrees.
15    Returns:
16        float: Brillouin shift in GHz.
17    """
18    
19    # Speed of sound in water as a function of temperature (in m/s)
20    # obtained by fitting a 4th-order polynomial to experimental data from Supplementary Table 1 of https://doi.org/10.1038/s41566-025-01681-6
21    # while assuming a constant refractive index of 1.333 across the temperature range of 20 to 40 °C
22    speed_of_sound = 1485.115245 - 6.273078 * temperature_C + 5.308978e-1 * temperature_C**2 + \
23                        -1.319485681e-2 * temperature_C**3 + 1.12602896e-4 * temperature_C**4
24    # Brillouin shift calculation (in GHz)
25    shift_ghz = 2 * speed_of_sound * refractive_index_water * sin(radians(scattering_angle_deg/2)) / wavelength_nm
26    return shift_ghz
27
28def Brillouin_width_water(wavelength_nm: float, temperature_C: float, scattering_angle_deg: float) -> float:
29    """
30    Calculate the Brillouin width for water at a given temperature and wavelength.
31
32    Args:
33        wavelength (float): Wavelength in nanometers.
34        temperature (float): Temperature in degrees Celsius. Valid range 20 to 40 °C.
35        scattering_angle (float): Scattering angle in degrees.
36    Returns:
37        float: Brillouin width in GHz.
38    """
39    
40    # Longitudinal viscosity in water as a function of temperature (in mm^2/s)
41    # obtained by fitting a 5th-order polynomial to experimental data from Supplementary Table 1 of https://doi.org/10.1038/s41566-025-01681-6
42    # while assuming a constant refractive index of 1.333 across the temperature range of 20 to 40 °C
43    longitudinal_viscosity = -49.087245994 + 9.27181683 * temperature_C + -0.655137659 * temperature_C**2 + \
44                        2.264061633e-002 * temperature_C**3  - 3.84984120021e-004* temperature_C**4 + \
45                        2.5816236806198040e-006 * temperature_C**5 
46    # Brillouin width calculation (in GHz)
47    width_ghz = 8e3 * pi * refractive_index_water**2 * longitudinal_viscosity * \
48                    (sin(radians(scattering_angle_deg/2)))**2 / (wavelength_nm)**2
49    return width_ghz
refractive_index_water = 1.333
def Brillouin_shift_water( wavelength_nm: float, temperature_C: float, scattering_angle_deg: float) -> float:
 8def Brillouin_shift_water(wavelength_nm: float, temperature_C: float, scattering_angle_deg: float) -> float:
 9    """
10    Calculate the Brillouin shift for water at a given temperature and wavelength.
11
12    Args:
13        wavelength (float): Wavelength in nanometers.
14        temperature (float): Temperature in degrees Celsius. Valid range 20 to 40 °C.
15        scattering_angle (float): Scattering angle in degrees.
16    Returns:
17        float: Brillouin shift in GHz.
18    """
19    
20    # Speed of sound in water as a function of temperature (in m/s)
21    # obtained by fitting a 4th-order polynomial to experimental data from Supplementary Table 1 of https://doi.org/10.1038/s41566-025-01681-6
22    # while assuming a constant refractive index of 1.333 across the temperature range of 20 to 40 °C
23    speed_of_sound = 1485.115245 - 6.273078 * temperature_C + 5.308978e-1 * temperature_C**2 + \
24                        -1.319485681e-2 * temperature_C**3 + 1.12602896e-4 * temperature_C**4
25    # Brillouin shift calculation (in GHz)
26    shift_ghz = 2 * speed_of_sound * refractive_index_water * sin(radians(scattering_angle_deg/2)) / wavelength_nm
27    return shift_ghz

Calculate the Brillouin shift for water at a given temperature and wavelength.

Arguments:
  • wavelength (float): Wavelength in nanometers.
  • temperature (float): Temperature in degrees Celsius. Valid range 20 to 40 °C.
  • scattering_angle (float): Scattering angle in degrees.
Returns:

float: Brillouin shift in GHz.

def Brillouin_width_water( wavelength_nm: float, temperature_C: float, scattering_angle_deg: float) -> float:
29def Brillouin_width_water(wavelength_nm: float, temperature_C: float, scattering_angle_deg: float) -> float:
30    """
31    Calculate the Brillouin width for water at a given temperature and wavelength.
32
33    Args:
34        wavelength (float): Wavelength in nanometers.
35        temperature (float): Temperature in degrees Celsius. Valid range 20 to 40 °C.
36        scattering_angle (float): Scattering angle in degrees.
37    Returns:
38        float: Brillouin width in GHz.
39    """
40    
41    # Longitudinal viscosity in water as a function of temperature (in mm^2/s)
42    # obtained by fitting a 5th-order polynomial to experimental data from Supplementary Table 1 of https://doi.org/10.1038/s41566-025-01681-6
43    # while assuming a constant refractive index of 1.333 across the temperature range of 20 to 40 °C
44    longitudinal_viscosity = -49.087245994 + 9.27181683 * temperature_C + -0.655137659 * temperature_C**2 + \
45                        2.264061633e-002 * temperature_C**3  - 3.84984120021e-004* temperature_C**4 + \
46                        2.5816236806198040e-006 * temperature_C**5 
47    # Brillouin width calculation (in GHz)
48    width_ghz = 8e3 * pi * refractive_index_water**2 * longitudinal_viscosity * \
49                    (sin(radians(scattering_angle_deg/2)))**2 / (wavelength_nm)**2
50    return width_ghz

Calculate the Brillouin width for water at a given temperature and wavelength.

Arguments:
  • wavelength (float): Wavelength in nanometers.
  • temperature (float): Temperature in degrees Celsius. Valid range 20 to 40 °C.
  • scattering_angle (float): Scattering angle in degrees.
Returns:

float: Brillouin width in GHz.