# -*- coding: utf-8 -*-
"""
Created on Fri Aug 27 15:14:48 2021

@author: Joschka
"""
from src import physical_constants as cs
import numpy as np


mu = 9.9* cs.mu_B

Grad_Bz = cs.m_Dy_164 * 9.81/(8*mu)

print("For levitation:")
print(f"dBz/dz = {Grad_Bz*1e4*1e-2:.4f} G/cm")
print("")

T = 10e-6
sigma = np.sqrt(cs.k_B*T/cs.m_Dy_164)
dz = 2*sigma * 10e-3
print(sigma*10e-3)

#dz = 250e-6
dt = 10e-3

Grad_Bz = 2 * dz * cs.m_Dy_164/(dt**2 * mu)


print(" ")
print("For Stern-Gerlach separation:")
print(f"dBz/dz = {Grad_Bz*1e4*1e-2:.4f} G/cm")
print(" ")


a = 8*mu*2.67*1e-2/cs.m_Dy_164 + 9.81
s = 0.5 * a * dt**2
print(s)

print(0.5*9.81*dt**2)

print((2.8778-2.8775)/2.8778)
print(16*dz)