Example_MZM
This is an example of how to set your CST simulation to create MZM
1import numpy as np
2import matplotlib.pyplot as plt
3import pandas as pandas
4import sys
5import os
6# Add the directory containing the project to sys.path
7current_path = os.path.dirname(os.path.abspath('__file__'))
8sys.path.append(current_path)
9from CST_Constructor import CST_Commands, Curves
10
11
12# =============================================================================
13# Open new MWS CST
14# =============================================================================
15
16
17obj = CST_Commands()
18obj.New_Project("MWS")
19
20
21# =============================================================================
22# Create the MZM
23# =============================================================================
24
25
26# Set Optical or Electrical Temptlates for the project
27# Units Properties
28Parameters = {}
29Parameters['Length'] = "um"
30Parameters['Frequency'] = "THz"
31Parameters['Time'] = "ns"
32Parameters['Temperature'] = "degC"
33
34# Set FreqeueWavelength Range
35Parameters["Min Wavelength"] = 1.5
36Parameters["Max Wavelength"] = 1.6
37
38
39# Set Background
40Parameters["Type Background"] = "Normal"
41Parameters["Xmin Background"] = 0
42Parameters["Xmax Background"] = 0
43Parameters["Ymin Background"] = 0
44Parameters["Ymax Background"] = 0
45Parameters["Zmin Background"] = 0
46Parameters["Zmax Background"] = 0
47
48
49# Set Boundary
50Parameters["Xmin Boundary"] = 'open'
51Parameters["Xmax Boundary"] = 'open'
52Parameters["Ymin Boundary"] = 'open'
53Parameters["Ymax Boundary"] = 'open'
54Parameters["Zmin Boundary"] = 'open'
55Parameters["Zmax Boundary"] = 'open'
56Parameters["Xsymmetry Boundary"] = 'none'
57Parameters["Ysymmetry Boundary"] = 'none'
58Parameters["Zsymmetry Boundary"] = 'none'
59
60# Mesh Settings
61Parameters["Mesh Type"] = "PBA"
62Parameters["Mesh Cells Near Object"] = 30
63Parameters["Mesh Cells far Object"] = 30
64
65obj.setOpticalSimulationProperties(Parameters)
66
67
68
69# MZM Parameters
70Parameters = {}
71Parameters["Electrodes Length"] = 50
72Parameters["Width GND"] = 40
73Parameters["Width Signal"] = 10
74Parameters["Width WG"] = 0.8
75Parameters["Gap"] = 1.565
76Parameters["Angle"] = 35
77Parameters["Height Electrodes"] = 0.8
78Parameters["Height WG"] = 0.4
79Parameters["Height Slab"] = 0.2
80Parameters["Height Substrate"] = 1
81Parameters["Angle X"] = 0
82Parameters["Angle Y"] = 90
83Parameters["Angle Z"] = 0
84
85
86# Create MZM
87obj.MZM(Parameters)