Calculators

This is a small collection of calculators useful for running β-NMR/β-NQR experiments at TRIUMF (see also https://bnmr.triumf.ca/).

Some of the calculators are web forms, where you simply enter a new value in one of the boxes on the page and press ENTER or click outside the box to update the values. Others are Python scripts, which can be downloaded and run on your own machine.

Table of contents

  1. Bandwidth-to-pulse-duration converter for modulated RF fields
  2. β-NMR antenna-pickup-to-RF-field converter
  3. β-NQR magnetic field calibration and calculator
  4. Demagnetization factors for common sample geometries
    1. Ellipsoid
    2. Rectangular prism
  5. Beamline optics

Bandwidth-to-pulse-duration converter for modulated RF fields

ln-sech Hermite
tpulse (ms) × Bw (Hz) = 5 × 104 tpulse (ms) × Bw (Hz) = 1764.8
Pulse duration [tpulse] (ms):
Bandwidth [Bw] (Hz):

β-NMR antenna-pickup-to-RF-field converter

H1 field
H1 (G) = 39.6 (G MHz/V) × Vp-p (V) / f (MHz)
Antenna pickup [Vp-p] (V):
RF frequency [f] (MHz): 41.27
RF field [H1] (G):

The above expression is accurate to ± 3 %. Note that this expression is only valid for data collected before September 2019!

β-NQR magnetic field calibration and calculator

ILE2A1:HH
H (G) = a (G) + b (G/A) × I (A)
Current setpoint [I] (A):
Magnetic field [H] (G):

The calibration constants are: a = 0.175 ± 0.046 G and b = 2.2131 ± 0.0019 G / A.

Demagnetization factors for common sample geometries

Ellipsoid

#!/usr/bin/python3

import numpy as np
from scipy.special import ellipeinc


# Demagnetization factor N/4π for an ellipsoid with semi-axes a, b, and c.
#
# J. A. Osborn.
# "Demagnetizing factors of the general ellipsoid".
# Phys. Rev. 67, 351 (1945).
# https://doi.org/10.1103/PhysRev.67.351
#
# General ellipsoid
# Equation (2.3) [a >= b >= c >= 0]
def N_ellipsoid(a, b, c):
    # Equation (2.4) - amplitude
    theta = np.arccos(c / a)
    # Equation (2.5)
    phi = np.arccos(b / a)
    # Equation (2.6) - modulus
    k = np.sin(phi) / np.sin(theta)
    alpha = np.arcsin(k)
    # convert to the notation used in SciPy
    # https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.ellipeinc.html
    m = np.power(k, 2)
    E = ellipeinc(theta, m)
    # Equation (2.3) - demagnetization factor for the general ellipsoid
    return (
        (np.cos(phi) * np.cos(theta))
        / (np.power(np.sin(theta), 3) * np.power(np.cos(alpha), 2))
        * (((np.sin(theta) * np.cos(phi)) / np.cos(theta)) - E)
    )

Download demagnetization_factor_ellipsoid.py.

Rectangular prism

#!/usr/bin/python3

import numpy as np


# Demagnetization factor N/4π for a rectangular prism with semi-axes a, b, and c.
#
# A. Aharoni.
# "Demagnetizing factors for rectangular ferromagnetic prisms".
# J. Appl. Phys. 83, 3422 (1998).
# https://doi.org/10.1063/1.367113
#
# Eq. (1) - see Fig. 1 for_abc coordinate system
# see also the online version of calculator
# http://www.magpar.net/static/magpar/doc/html/demagcalc.html
def N_prism(a, b, c):
    # the expression takes input as half of the semi-axes
    a = 0.5 * a
    b = 0.5 * b
    c = 0.5 * c
    # define some convenience terms
    a2 = a * a
    b2 = b * b
    c2 = c * c
    abc = a * b * c
    ab = a * b
    ac = a * c
    bc = b * c
    r_abc = np.sqrt(a2 + b2 + c2)
    r_ab = np.sqrt(a2 + b2)
    r_bc = np.sqrt(b2 + c2)
    r_ac = np.sqrt(a2 + c2)
    # compute the factor
    pi_N = (
        ((b2 - c2) / (2 * bc)) * np.log((r_abc - a) / (r_abc + a))
        + ((a2 - c2) / (2 * ac)) * np.log((r_abc - b) / (r_abc + b))
        + (b / (2 * c)) * np.log((r_ab + a) / (r_ab - a))
        + (a / (2 * c)) * np.log((r_ab + b) / (r_ab - b))
        + (c / (2 * a)) * np.log((r_bc - b) / (r_bc + b))
        + (c / (2 * b)) * np.log((r_ac - a) / (r_ac + a))
        + 2 * np.arctan2(ab, c * r_abc)
        + (a2 * a + b2 * b - 2 * c2 * c) / (3 * abc)
        + ((a2 + b2 - 2 * c2) / (3 * abc)) * r_abc
        + (c / ab) * (r_ac + r_bc)
        - (r_ab * r_ab * r_ab + r_bc * r_bc * r_bc + r_ac * r_ac * r_ac) / (3 * abc)
    )
    # divide out the factor of pi
    return pi_N / np.pi

Download demagnetization_factor_prism.py.

Beamline optics

See: https://beta.hla.triumf.ca/beam/tuneX/.


Copyright © 2020-2023 Ryan M. L. McFadden.