Miscellaneous#
formula.misc
module#
- mrfmsim.formula.misc.convert_grid_pts(distance, grid_step)[source]#
Convert distance to ext points.
- Parameters:
distance (int) – distance in the x direction.
- mrfmsim.formula.misc.neg_sum_of_product(*args)[source]#
Calculate the negative sum of the product input values.
The args can be a list of values, since numpy multiple can calculate the value. The function is used to simplify the definition in some of the experiments. The approximation of the signal results in a negative sign at the front.
- mrfmsim.formula.misc.singlespin_analytical(Gamma, geometry, J, magnet_spin_dist, magnet_origin, magnet_radius, mu0_Ms, x_0p)[source]#
The analytical calculation for a single spin.
The analytical solution to the exact equations for the delta k without any approximations as derived below: \(\Delta f = - \frac{f}{k x_{pk}^2} \langle F_{ts} x \rangle\) where \(x_{pk}\) is the zero-to-peak amplitude of the cantilever. This equation can be expressed as an integral over an angle \(\theta\) For the hangdown geometry,
\[F_{ts} = \mu_z \mu_0 M r^3 \dfrac{x^3 - 4z^2x}{(z^2 + x^2)^{7/2}}\]For the SPAM geometry, \(F_{ts} = \dfrac{\mu_z \mu_0 M r^3 x}{(x^2 + y^2)^{5/2}}\) where \(\mu_z\) is the spin magnetic moment, \(\mu_0 M\) is the saturation magnetization of the tip, and r is the tip radius.
\[\Delta f = \frac{f}{2 \pi k x_{pk}^2} \int_{-\pi}^{\pi} \mu(x,y,z,\theta) \times \frac{\partial B_{z}^{\mathrm{tip}} (x-x_{pk}\cos \theta, y, z)}{\partial x} x_{pk}\cos \theta d\theta\]Substituting into the integral and introducing a unitless variable \(\hat{z} = z/x_{peak}\) for the hangdown geometry and \(\hat{y}/x_{peak}\) for the SPAM geometry, we obtain the following integrals:
\[\Delta f = \frac{f}{2 k x_{pk}}\frac{\mu_z \mu_0 M}{a} (\frac{a}{z})^4 \times \frac{\bar{z}^4}{\pi} \int_0^{2\pi} \frac{\cos^4 \theta - 4\hat{z}^2\cos^2\theta} {(\hat{z}^2 + \cos^2\theta)^{7/2}} d\theta\]This integral (along with the \(\frac{\hat{z}^4}{\pi}\) prefactor) can be solved exactly in Mathematica to give a solution in terms of Elliptic Integrals
\[\frac{\hat{z}^3}{3\pi(\hat{z}^2 +1)}(4(2\hat{z}^4 - 7\hat{z}^2 -1)E(-1/\hat{z}^2) -8(\hat{z}^4 - 1)K(-1/\hat{z}^2))\]where \(K(m)\) and \(E(m)\) are, respectively, the complete elliptic integrals of the first and second kind. For the SPAM geometry,
\[\Delta f = \frac{f}{2 k x_{pk}} \frac{\mu_z \mu_0 M} {z} \left(\frac{a}{y}\right)^4 \times \frac{\hat{z}^4}{\pi} \int_0^{2\pi}\frac{\cos^2 \theta}{(\cos^2 \theta + \hat{y}^2)^{5/2}}d\theta\]This integral (along with the \(\frac{\hat{y}^4}{\pi}\) prefactor can be solved exactly in terms of Elliptic integrals:
\[\frac{4\hat{y}^3}{3\pi(1+\hat{y}^2)^2}[(1+\hat{y}^2)E(-1/\hat{y}^2) - (\hat{y}^2 -1)K(-1/\hat{y}^2)\]- Parameters:
Gamma (float) – the gyromagnetic ratio
J (float) – the spin angular momentum
magnet_origin (array) – the origin of the magnet
magnet_radius (float) – the radius of the magnet
mu0_Ms (float) – the saturation magnetization of the magnet
mu_z (float) – the spin magnetic moment
magnet_spin_distance (float) – magnet-spin distance
- Returns:
The analytical solution for a single spin (effective force). The spin constant shift is the effective force divided by the 0 to peak amplitude.