#!/usr/bin/env python # coding: utf-8 # # Tutorial 08: Defining micromagnetic system # # > Interactive online tutorial: # > [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ubermag/micromagneticmodel/master?filepath=docs%2Fipynb%2Findex.ipynb) # # A micromagnetic system is the main entity of the micromagnetic model. It consists of three main components: # - Hamiltonian # - Dynamics equation # - Magnetisation configuration # # In this tutorial, we will assemble a micromagnetic system, which can then be "driven" using different drivers. # In[1]: import micromagneticmodel as mm # Firstly, we create a Hamiltonian: # In[2]: hamiltonian = mm.Exchange(A=1e-11) + mm.Zeeman(H=(1e6, 0, 0)) # Next, we define the dynamics equation. # In[3]: dynamics = mm.Precession(gamma=mm.consts.gamma0) + mm.Damping(alpha=0.1) # Finally, magnetisation configuration must be defined as `discretisationfield.Field`. # In[4]: import discretisedfield as df p1 = (0, 0, 0) p2 = (10e-9, 10e-9, 10e-9) n = (5, 5, 5) Ms = 1e6 mesh = df.Mesh(p1=p1, p2=p2, n=n) m = df.Field(mesh, dim=3, value=(0, 0, 1), norm=Ms) # Using these three parameters we can assemble the system object. # In[5]: system = mm.System(hamiltonian=hamiltonian, dynamics=dynamics, m=m, name='mysystem') # We can now check some basics properties of the assembled system. # In[6]: system # In[7]: system.hamiltonian # In[8]: system.dynamics # In[9]: # NBVAL_IGNORE_OUTPUT system.m.k3d_vectors() # ## Other # # Full description of all existing descriptors can be found in the [API Reference](https://micromagneticmodel.readthedocs.io/en/latest/?badge=latest).