Magnetization-graded waveguides#
example taken from the paper of R. Gallardo et al., Nanomaterials 10.3390/nano12162785 (https://www.mdpi.com/2079-4991/12/16/2785)
[1]:
%matplotlib notebook
import matplotlib.pyplot as plt
import tetrax as tx
import numpy as np
Sample definition as a waveguidewith graded saturation magnetization#
first we create a rectangular waveguide
[2]:
sample = tx.create_sample(geometry="waveguide",name="Recteaveguide_graded")
total_thickness = 1
res = 5
width = 200
sample.set_geom(tx.geometries.rectangle_cross_section(width,total_thickness,res,res))
Setting geometry and calculating discretized differential operators on mesh.
Done.
This is the definition of a windowing function to set a graded magnetization
[3]:
def R(u):
"""
Auxiliary R function that appears in the windowing function c_inf_window.
"""
return np.piecewise(u,[u<=0, u>0],[0, lambda u : np.exp(-1/u)])
def S(u):
"""
Auxiliary S function that appears in the windowing function c_inf_window.
"""
return R(u)/(R(u)+R(1-u))
def cinf_window(t0, T, tau, A, t):
u = (t - t0)/tau
y = A*S(u)*S(T/tau-u)
return y
Lets set a graded magnetization to mimic an ion irradiation of a Permallow waveguide with the highest fleunce in the middle
using the linescan option we can show the magnetization across the width of the waveguide
[4]:
sample.gamma = 185.66e9
sample.Aex = 9.9e-12
Msat_Py = 800e3
Msat_Pyirrad = 400e3
zeta = 100
rise = 25
Msat_ = Msat_Py - cinf_window(-zeta/2,zeta,rise,Msat_Pyirrad,sample.xyz.x)
sample.Msat = Msat_
# One can print the value of the average saturation magnetization
print("Msat_avrg = ", sample.Msat_avrg)
# Here we plot the saturation magnetization across the width:
plt.rcParams["figure.figsize"] = (8,7)
plt.figure()
scan, line = sample.scan_along_curve(sample.Msat,((-150,0,0), (150,0,0)), num_points=100, return_curve=True)
plt.plot(line[:,0],scan, label="$M_{sat}$")
plt.xlabel("x")
plt.ylabel("Saturation magnetization (A/m)")
plt.legend()
plt.show()
Msat_avrg = 650000.0
Experiment with external field only#
[5]:
sample.mag = tx.vectorfields.homogeneous(sample.xyz,90,10)
exp = tx.create_experimental_setup(sample)
exp.Bext = [300e-3,0,0]
exp.relax(tol=1e-11)
sample.show()
Minimizing in using 'L-BFGS-B' (tolerance 1e-11) ...
Current energy length density: -1.003783602489040e-22 J/m mx = 1.00 my = 0.00 mz = -0.00
Success!
/Users/attilak/anaconda3/lib/python3.10/site-packages/traittypes/traittypes.py:97: UserWarning: Given trait value dtype "float32" does not match required type "float32". A coerced copy has been created.
warnings.warn(
Dispersion calculation for first N = 10 number of nodes#
[6]:
disp = exp.eigenmodes(kmin=-40e6,kmax=40e6,Nk=81, num_cpus=-1,num_modes=10,save_modes=True,no_dip=False)
100%|█████████████████████████████| 81/81 [00:13<00:00, 6.10it/s]
Plotting the dispersion#
[7]:
plt.rcParams["figure.figsize"] = (8,7)
plt.figure()
for i in range(10):
plt.plot(disp["k (rad/m)"].values*1e-6,disp[f"f{i} (GHz)"].values,ls='',marker='.',c='black', alpha=0.2)
plt.xlabel("k (rad/µm)")
plt.ylabel("frequency (GHz)")
plt.xlim([-30,30])
plt.ylim([14,22])
plt.grid(color='0.95')
plt.show()
For a detailed analysis of the modes, please check the publication:#
Gallardo et al., Nanomaterials 10.3390/nano12162785 (https://www.mdpi.com/2079-4991/12/16/2785)