Home Forums GENERAL Cut-off wavelength in PCF Reply To: Cut-off wavelength in PCF

#18342
Profile Photo
Bijan goudarzi
Participant

Dear Marek,
Follow your tip, I went to design my PCF with optiMODE. I was going to do it base on OptiMode_User_Reference pdf file (section: OptiMode Tutorial 5- Photonic Crystal Fiber and VB script). but the script given by the tutorial return error and cant made the PCF structure. here is the exact script of the tutorial and at the end is the returned error,

‘ Make the hexagonal crystal lattice fibre of
‘ Optics Letters Vol.22 No. 13 p961 (1997)
Option Explicit
WGMgr.DeleteAll
Dim X0,Y0,Nperiods,i,j,YLevel,Pitch,HoleDiameter,x_coord
Dim wg_object, Xdefect, Ydefect, windowsz

windowsz = ParamMgr.EvaluateExpr(“window”)

Nperiods = 9
Pitch = 2.3
X0 = – (Nperiods/2 – 0.5) * Pitch
Y0 = – (Nperiods – 1) * (3)^(0.5) * Pitch / 2.0
HoleDiameter = 0.45 * Pitch

Xdefect = Nperiods
Ydefect = Nperiods

WGMgr.OutputMSG(” Periods = ” & Nperiods & ” Pitch = ” & Pitch & _
” Hole Diameter = ” & HoleDiameter)
‘ Create the lower half of the photonic crysal.
‘ Don’t put a waveguide at i = j = Nperiods
For j = 1 To Nperiods
YLevel = Y0 + (j-1) * (3)^(0.5) * Pitch / 2.0
If YLevel > – windowsz / 2 Then
For i = 1 To Nperiods + j – 1
x_coord = X0 + (i – 1) * Pitch – (j – 1) * Pitch / 2.0
If( (i<>Xdefect Or j<>Ydefect) And x_coord < windowsz / 2 _
And x_coord > – windowsz / 2 ) Then
Set wg_object = WGMgr.CreateObj(“WGLinearXS”, “Hole_”& _
CStr(j)&”_”&CStr(i) )
wg_object.SetStart x_coord, YLevel
wg_object.SetAttr “WidthExpr”, CStr(HoleDiameter)
wg_object.SetProfileName “Hole”
End If
Next
End If
Next

‘ Create the upper half of the photonic crystal
For j = Nperiods + 1 To 2 * Nperiods – 1
YLevel = Y0 + (j-1) * (3)^(0.5) * Pitch / 2.0
If YLevel < windowsz / 2 Then
For i = 1 To 3 * Nperiods – j – 1
x_coord = X0 + (i – 1) * Pitch + (j – 2 * Nperiods + 1) _
* Pitch / 2.0
If x_coord < windowsz / 2 And x_coord > – windowsz / 2 Then
Set wg_object = WGMgr.CreateObj(“WGLinearXS”, “Hole_” _
&CStr(j) &”_”&CStr(i) )

wg_object.SetStart x_coord, YLevel
wg_object.SetAttr “WidthExpr”, CStr(HoleDiameter)
wg_object.SetProfileName “Hole”
End If
Next
End If
Next

VB scripting: ‘Microsoft VBScript runtime error’ Line:25,char:4, ‘Type mismatch: ‘[string: “Error: Unknown varia”]”

*Line 25 is refered to: If YLevel > – windowsz / 2 Then

what is wrong with it?

Categories