Example_Waveguide
This is an example of how to set your CST simulation to create Waveguide
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# =============================================================================
14# Open new MWS CST
15# =============================================================================
16
17
18obj = CST_Commands()
19obj.New_Project("MWS")
20
21
22# =============================================================================
23# Create the Waveguide
24# =============================================================================
25
26
27# Set Optical or Electrical Temptlates for the project
28# Units Properties
29Parameters = {}
30Parameters['Length'] = "um"
31Parameters['Frequency'] = "THz"
32Parameters['Time'] = "ns"
33Parameters['Temperature'] = "degC"
34
35# Set FreqeueWavelength Range
36Parameters["Min Wavelength"] = 1.5
37Parameters["Max Wavelength"] = 1.6
38
39
40# Set Background
41Parameters["Type Background"] = "Normal"
42Parameters["Xmin Background"] = 0
43Parameters["Xmax Background"] = 0
44Parameters["Ymin Background"] = 0
45Parameters["Ymax Background"] = 0
46Parameters["Zmin Background"] = 0
47Parameters["Zmax Background"] = 0
48
49
50# Set Boundary
51Parameters["Xmin Boundary"] = 'open'
52Parameters["Xmax Boundary"] = 'open'
53Parameters["Ymin Boundary"] = 'open'
54Parameters["Ymax Boundary"] = 'open'
55Parameters["Zmin Boundary"] = 'open'
56Parameters["Zmax Boundary"] = 'open'
57Parameters["Xsymmetry Boundary"] = 'none'
58Parameters["Ysymmetry Boundary"] = 'none'
59Parameters["Zsymmetry Boundary"] = 'none'
60
61# Mesh Settings
62Parameters["Mesh Type"] = "PBA"
63Parameters["Mesh Cells Near Object"] = 30
64Parameters["Mesh Cells far Object"] = 30
65
66obj.setOpticalSimulationProperties(Parameters)
67
68
69# Create Waveguide
70
71Parameters = {}
72Parameters["Length WG"] = 5
73Parameters["Height WG"] = 0.3
74Parameters["Width WG"] = 1
75Parameters["Substrate Height"] = 1
76Parameters["Slab Height"] = 0.3
77
78obj.Squere_Waveguide(Parameters)
79
80
81