-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphysics.py
More file actions
49 lines (38 loc) · 1.4 KB
/
physics.py
File metadata and controls
49 lines (38 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import numpy as np
class phy:
" Class that defines the physics of the model."
def __init__( self,
n_metal,
k_metal,
n_back,
k_back,
mu,
scale,
wavelength,
alpha = 0.0):
"""
@ n_metal : Value for the refractive index of the metal.
@ k_r : Value for the exctinction coefficient of the metal.
@ n_metal: Value for the refractive index of the waveguide.
@ n_back: Value for the refractive index of the cladding.
@ scale: scale of the physical problem; i.e. 1e-9 for nm.
@ wavelength: Wavelength of the problem (Frequency domain solver).
"""
# ------------------------------------------------------------------
# ELECTROMAGNETICS
# ------------------------------------------------------------------
self.n_metal = n_metal
self.eps_metal = n_metal**2
self.k_metal = k_metal
self.n_back = n_back
self.eps_back = n_back**2
self.k_back = k_back
self.mu = mu
self.scale = scale
self.wavelength = wavelength
self.k = 2 * np.pi / (self.wavelength * self.scale)
self.eps_0 = 8.85e-12
self.mu_0 = 1.257e-6
self.c = 3e8
self.Z0 = np.sqrt(self.mu_0/self.eps_0)
self.alpha = alpha