Example #1
0
def excite_system_D(mesh, Hx=2000):

    A = 1.3e-11
    Ms = 8.6e5
    mu0 = 4 * np.pi * 1e-7
    G = A / (mu0 * Ms**2)

    Nx = 0
    Ny = 0.4
    Nz = 0.6

    sim = Sim(mesh, name='dyn_D')

    sim.set_tols(rtol=1e-8, atol=1e-8)
    sim.gamma = 2.211e5
    sim.Ms = Ms
    sim.alpha = 0.005

    sim.set_m(np.load('m0.npy'))

    exch = UniformExchange(A=A)
    sim.add(exch)

    demag = SimpleDemag(Nx=Nx, Ny=Ny, Nz=Nz)
    sim.add(demag)

    hx = Zeeman((Hx, 0, 0), name='Hx')
    sim.add(hx, save_field=True)

    ts = np.linspace(0, 5e-9, 101)
    for t in ts:
        print 'time', t
        sim.run_until(t)
Example #2
0
def excite_system_K(mesh, Hx=2000):

    A = 1.3e-11
    Ms = 8.6e5
    mu0 = 4 * np.pi * 1e-7
    G = A / (mu0 * Ms**2)

    Nx = 0
    Ny = 0.4
    Nz = 0.6

    K = 0.5 * (Ny - Nx) * mu0 * Ms**2
    Kp = -0.5 * (Nz - Ny) * mu0 * Ms**2

    sim = Sim(mesh, name='dyn_K')

    sim.set_tols(rtol=1e-8, atol=1e-8)
    sim.gamma = 2.211e5
    sim.Ms = Ms
    sim.alpha = 0.005

    sim.set_m(np.load('m0.npy'))

    exch = UniformExchange(A=A)
    sim.add(exch)

    kx = UniaxialAnisotropy(K, axis=(1, 0, 0))
    sim.add(kx)

    kp = UniaxialAnisotropy(Kp, axis=(0, 0, 1))
    sim.add(kp)

    hx = Zeeman((Hx, 0, 0), name='Hx')
    sim.add(hx, save_field=True)

    ts = np.linspace(0, 5e-9, 501)
    for t in ts:
        print 'time', t
        sim.run_until(t)