'# MWS Version: Version 2014.3 - Jul 03 2014 - ACIS 23.0.0 -

'# length = mm
'# frequency = MHz
'# time = ns
'# frequency range: fmin = 1700 fmax = 2300
'# created = '[VERSION]2014.3|23.0.0|20140703[/VERSION]


'@ use template: Antenna - Wire_1

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
'set the units
With Units
    .Geometry "mm"
    .Frequency "MHz"
    .Voltage "V"
    .Resistance "Ohm"
    .Inductance "NanoH"
    .TemperatureUnit  "Celsius"
    .Time "ns"
    .Current "A"
    .Conductance "Siemens"
    .Capacitance "PikoF"
End With
ThermalSolver.AmbientTemperature "0"
'----------------------------------------------------------------------------
Plot.DrawBox True
With Background
     .Type "Normal"
     .Epsilon "1.0"
     .Mue "1.0"
     .XminSpace "0.0"
     .XmaxSpace "0.0"
     .YminSpace "0.0"
     .YmaxSpace "0.0"
     .ZminSpace "0.0"
     .ZmaxSpace "0.0"
End With
With Boundary
     .Xmin "expanded open"
     .Xmax "expanded open"
     .Ymin "expanded open"
     .Ymax "expanded open"
     .Zmin "expanded open"
     .Zmax "expanded open"
     .Xsymmetry "none"
     .Ysymmetry "none"
     .Zsymmetry "none"
End With
' switch on FD-TET setting for accurate farfields
FDSolver.ExtrudeOpenBC "True"
Mesh.FPBAAvoidNonRegUnite "True"
Mesh.ConsiderSpaceForLowerMeshLimit "False"
Mesh.MinimumStepNumber "5"
Mesh.RatioLimit "20"
Mesh.AutomeshRefineAtPecLines "True", "10"
With MeshSettings
     .SetMeshType "Hex"
     .Set "RatioLimitGeometry", "20"
     .Set "EdgeRefinementOn", "1"
     .Set "EdgeRefinementRatio", "10"
End With
With MeshSettings
     .SetMeshType "Tet"
     .Set "VolMeshGradation", "1.5"
     .Set "SrfMeshGradation", "1.5"
End With
With MeshSettings
     .SetMeshType "HexTLM"
     .Set "RatioLimitGeometry", "20"
End With
PostProcess1D.ActivateOperation "vswr", "true"
PostProcess1D.ActivateOperation "yz-matrices", "true"
With MeshSettings
     .SetMeshType "Srf"
     .Set "Version", 1
End With
IESolver.SetCFIEAlpha "1.000000"
'----------------------------------------------------------------------------
'set the frequency range
Solver.FrequencyRange "700", "2500"
Dim sDefineAt As String
sDefineAt = "700;1600;2500"
Dim sDefineAtName As String
sDefineAtName = "700;1600;2500"
Dim sDefineAtToken As String
sDefineAtToken = "f="
Dim aFreq() As String
aFreq = Split(sDefineAt, ";")
Dim aNames() As String
aNames = Split(sDefineAtName, ";")
Dim nIndex As Integer
For nIndex = LBound(aFreq) To UBound(aFreq)
Dim zz_val As String
zz_val = aFreq (nIndex)
Dim zz_name As String
zz_name = sDefineAtToken & aNames (nIndex)
' Define Farfield Monitors
With Monitor
    .Reset
    .Name "farfield ("& zz_name &")"
    .Domain "Frequency"
    .FieldType "Farfield"
    .Frequency zz_val
    .ExportFarfieldSource "False"
    .Create
End With
Next
'----------------------------------------------------------------------------
With MeshSettings
     .SetMeshType "Hex"
     .Set "Version", 1%
End With
With Mesh
     .MeshType "PBA"
End With
'set the solver type
ChangeSolverType("HF Time Domain")

'@ import autodesk inventor file: D:\Autodesk Invertor 2011\Projects2014\Antenna\Xpol\XPol.iam

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With AutodeskInventor
     .Reset 
     .Healing "0" 
     .ScaleToUnit "0" 
     .FileName "D:\Autodesk Invertor 2011\Projects2014\Antenna\Xpol\XPol.iam" 
     .Id "1" 
     .Version "10.1" 
     .ImportToActiveCoordinateSystem "True" 
     .Curves "True" 
     .Read 
End With

'@ define material: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With Material
     .Reset
     .Name "Zinc"
     .Folder ""
.FrqType "all" 
.Type "Lossy metal" 
.SetMaterialUnit "GHz", "mm"
.Epsilon "1" 
.Mue "1" 
.Kappa "1.69e+007" 
.TanD "0.0" 
.TanDFreq "0.0" 
.TanDGiven "False" 
.TanDModel "ConstTanD" 
.KappaM "0" 
.TanDM "0.0" 
.TanDMFreq "0.0" 
.TanDMGiven "False" 
.TanDMModel "ConstTanD" 
.DispModelEps "None" 
.DispModelMue "None" 
.DispersiveFittingSchemeEps "General 1st" 
.DispersiveFittingSchemeMue "General 1st" 
.UseGeneralDispersionEps "False" 
.UseGeneralDispersionMue "False" 
.Rho "7100" 
.ThermalType "Normal" 
.ThermalConductivity "116" 
.HeatCapacity "0.39"
.MechanicsType "Isotropic"
.YoungsModulus "96.5"
.PoissonsRatio "0.32"
.ThermalExpansionRate "31"
.Colour "0.25098", "0.501961", "0.501961" 
.Wireframe "False" 
.Transparency "0" 
.Create
End With

'@ change material: default:import_1 to: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solid.ChangeMaterial "default:import_1", "Zinc"

'@ change material: default:import_2 to: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solid.ChangeMaterial "default:import_2", "Zinc"

'@ change material: default:import_3 to: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solid.ChangeMaterial "default:import_3", "Zinc"

'@ change material: default:import_4 to: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solid.ChangeMaterial "default:import_4", "Zinc"

'@ change material: default:import_5 to: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solid.ChangeMaterial "default:import_5", "Zinc"

'@ define time domain solver parameters

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Mesh.SetCreator "High Frequency" 
With Solver 
     .Method "Hexahedral"
     .CalculationType "TD-S"
     .StimulationPort "All"
     .StimulationMode "All"
     .SteadyStateLimit "-30.0"
     .MeshAdaption "False"
     .AutoNormImpedance "False"
     .NormingImpedance "50"
     .CalculateModesOnly "False"
     .SParaSymmetry "False"
     .StoreTDResultsInCache  "False"
     .FullDeembedding "False"
     .SuperimposePLWExcitation "False"
     .UseSensitivityAnalysis "False"
End With

'@ farfield plot options

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With FarfieldPlot 
     .Plottype "3D" 
     .Vary "angle1" 
     .Theta "90" 
     .Phi "90" 
     .Step "5" 
     .Step2 "5" 
     .SetLockSteps "True" 
     .SetPlotRangeOnly "False" 
     .SetThetaStart "0" 
     .SetThetaEnd "180" 
     .SetPhiStart "0" 
     .SetPhiEnd "360" 
     .SetTheta360 "False" 
     .SymmetricRange "False" 
     .SetTimeDomainFF "False" 
     .SetFrequency "1600" 
     .SetTime "0" 
     .SetColorByValue "True" 
     .DrawStepLines "False" 
     .DrawIsoLongitudeLatitudeLines "False" 
     .ShowStructure "True" 
     .SetStructureTransparent "False" 
     .SetFarfieldTransparent "True" 
     .SetSpecials "enablepolarextralines" 
     .SetPlotMode "Directivity" 
     .Distance "1" 
     .UseFarfieldApproximation "True" 
     .SetScaleLinear "False" 
     .SetLogRange "40" 
     .SetLogNorm "0" 
     .DBUnit "0" 
     .EnableFixPlotMaximum "False" 
     .SetFixPlotMaximumValue "1" 
     .SetInverseAxialRatio "False" 
     .SetAxesType "user" 
     .SetAntennaType "unknown" 
     .Phistart "1.000000e+000", "0.000000e+000", "0.000000e+000" 
     .Thetastart "0.000000e+000", "0.000000e+000", "1.000000e+000" 
     .PolarizationVector "0.000000e+000", "1.000000e+000", "0.000000e+000" 
     .SetCoordinateSystemType "spherical" 
     .SetAutomaticCoordinateSystem "True" 
     .SetPolarizationType "Linear" 
     .SlantAngle 0.000000e+000 
     .Origin "bbox" 
     .Userorigin "0.000000e+000", "0.000000e+000", "0.000000e+000" 
     .SetUserDecouplingPlane "False" 
     .UseDecouplingPlane "False" 
     .DecouplingPlaneAxis "X" 
     .DecouplingPlanePosition "0.000000e+000" 
     .LossyGround "False" 
     .GroundEpsilon "1" 
     .GroundKappa "0" 
     .EnablePhaseCenterCalculation "False" 
     .SetPhaseCenterAngularLimit "3.000000e+001" 
     .SetPhaseCenterComponent "boresight" 
     .SetPhaseCenterPlane "both" 
     .ShowPhaseCenter "True" 
     .StoreSettings
End With

'@ define farfield monitor: farfield (f=1252)

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With Monitor 
     .Delete "farfield (f=1600)" 
End With 
With Monitor 
     .Reset 
     .Name "farfield (f=1252)" 
     .Domain "Frequency" 
     .FieldType "Farfield" 
     .Frequency "1252" 
     .UseSubvolume "False" 
     .ExportFarfieldSource "False" 
     .SetSubvolume  "0.0",  "0.0",  "0.0",  "0.0",  "0.0",  "0.0" 
     .Create 
End With

'@ change material: default:import_6 to: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solid.ChangeMaterial "default:import_6", "Zinc"

'@ change material: default:import_7 to: Zinc

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solid.ChangeMaterial "default:import_7", "Zinc"

'@ pick circle point

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Pick.PickCirclepointFromId "default:import_6", "5"

'@ pick face

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Pick.PickFaceFromId "default:import_1", "18"

'@ define discrete port: 1

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With DiscretePort 
     .Reset 
     .PortNumber "1" 
     .Type "SParameter" 
     .Label "" 
     .Impedance "50.0" 
     .VoltagePortImpedance "0.0" 
     .Voltage "1.0" 
     .Current "1.0" 
     .SetP1 "True", "5.5", "-29.5", "2" 
     .SetP2 "True", "5.5", "-29.5", "1" 
     .InvertDirection "False" 
     .LocalCoordinates "False" 
     .Monitor "True" 
     .Radius "0.0" 
     .Wire "" 
     .Position "end1" 
     .Create 
End With

'@ pick circle point

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Pick.PickCirclepointFromId "default:import_7", "6"

'@ pick face

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Pick.PickFaceFromId "default:import_1", "18"

'@ define discrete port: 2

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With DiscretePort 
     .Reset 
     .PortNumber "2" 
     .Type "SParameter" 
     .Label "" 
     .Impedance "50.0" 
     .VoltagePortImpedance "0.0" 
     .Voltage "1.0" 
     .Current "1.0" 
     .SetP1 "True", "-29.5", "5.5", "2" 
     .SetP2 "True", "-29.5", "5.5", "1" 
     .InvertDirection "False" 
     .LocalCoordinates "False" 
     .Monitor "True" 
     .Radius "0.0" 
     .Wire "" 
     .Position "end1" 
     .Create 
End With

'@ define frequency range

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
Solver.FrequencyRange "1700", "2300"

'@ define farfield monitor: farfield (f=1930)

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With Monitor 
     .Delete "farfield (f=700)" 
End With 
With Monitor 
     .Reset 
     .Name "farfield (f=1930)" 
     .Domain "Frequency" 
     .FieldType "Farfield" 
     .Frequency "1930" 
     .UseSubvolume "False" 
     .ExportFarfieldSource "False" 
     .SetSubvolume  "0.0",  "0.0",  "0.0",  "0.0",  "0.0",  "0.0" 
     .Create 
End With

'@ define farfield monitor: farfield (f=2050)

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With Monitor 
     .Delete "farfield (f=1252)" 
End With 
With Monitor 
     .Reset 
     .Name "farfield (f=2050)" 
     .Domain "Frequency" 
     .FieldType "Farfield" 
     .Frequency "2050" 
     .UseSubvolume "False" 
     .ExportFarfieldSource "False" 
     .SetSubvolume  "0.0",  "0.0",  "0.0",  "0.0",  "0.0",  "0.0" 
     .Create 
End With

'@ define farfield monitor: farfield (f=2150)

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With Monitor 
     .Delete "farfield (f=2500)" 
End With 
With Monitor 
     .Reset 
     .Name "farfield (f=2150)" 
     .Domain "Frequency" 
     .FieldType "Farfield" 
     .Frequency "2150" 
     .UseSubvolume "False" 
     .ExportFarfieldSource "False" 
     .SetSubvolume  "0.0",  "0.0",  "0.0",  "0.0",  "0.0",  "0.0" 
     .Create 
End With

'@ farfield plot options

'[VERSION]2014.3|23.0.0|20140703[/VERSION]
With FarfieldPlot 
     .Plottype "3D" 
     .Vary "angle1" 
     .Theta "90" 
     .Phi "90" 
     .Step "5" 
     .Step2 "5" 
     .SetLockSteps "True" 
     .SetPlotRangeOnly "False" 
     .SetThetaStart "0" 
     .SetThetaEnd "180" 
     .SetPhiStart "0" 
     .SetPhiEnd "360" 
     .SetTheta360 "False" 
     .SymmetricRange "False" 
     .SetTimeDomainFF "False" 
     .SetFrequency "1600" 
     .SetTime "0" 
     .SetColorByValue "True" 
     .DrawStepLines "False" 
     .DrawIsoLongitudeLatitudeLines "False" 
     .ShowStructure "True" 
     .SetStructureTransparent "False" 
     .SetFarfieldTransparent "True" 
     .SetSpecials "enablepolarextralines" 
     .SetPlotMode "Directivity" 
     .Distance "1" 
     .UseFarfieldApproximation "True" 
     .SetScaleLinear "False" 
     .SetLogRange "40" 
     .SetLogNorm "0" 
     .DBUnit "0" 
     .EnableFixPlotMaximum "False" 
     .SetFixPlotMaximumValue "1" 
     .SetInverseAxialRatio "False" 
     .SetAxesType "user" 
     .SetAntennaType "unknown" 
     .Phistart "1.000000e+000", "0.000000e+000", "0.000000e+000" 
     .Thetastart "0.000000e+000", "0.000000e+000", "1.000000e+000" 
     .PolarizationVector "0.000000e+000", "1.000000e+000", "0.000000e+000" 
     .SetCoordinateSystemType "spherical" 
     .SetAutomaticCoordinateSystem "True" 
     .SetPolarizationType "Linear" 
     .SlantAngle 0.000000e+000 
     .Origin "bbox" 
     .Userorigin "0.000000e+000", "0.000000e+000", "0.000000e+000" 
     .SetUserDecouplingPlane "False" 
     .UseDecouplingPlane "False" 
     .DecouplingPlaneAxis "X" 
     .DecouplingPlanePosition "0.000000e+000" 
     .LossyGround "False" 
     .GroundEpsilon "1" 
     .GroundKappa "0" 
     .EnablePhaseCenterCalculation "False" 
     .SetPhaseCenterAngularLimit "3.000000e+001" 
     .SetPhaseCenterComponent "boresight" 
     .SetPhaseCenterPlane "both" 
     .ShowPhaseCenter "True" 
     .StoreSettings
End With 

