HFSS的近场仿真教学内容.docx

上传人:b****5 文档编号:8291924 上传时间:2023-01-30 格式:DOCX 页数:22 大小:1.12MB
下载 相关 举报
HFSS的近场仿真教学内容.docx_第1页
第1页 / 共22页
HFSS的近场仿真教学内容.docx_第2页
第2页 / 共22页
HFSS的近场仿真教学内容.docx_第3页
第3页 / 共22页
HFSS的近场仿真教学内容.docx_第4页
第4页 / 共22页
HFSS的近场仿真教学内容.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

HFSS的近场仿真教学内容.docx

《HFSS的近场仿真教学内容.docx》由会员分享,可在线阅读,更多相关《HFSS的近场仿真教学内容.docx(22页珍藏版)》请在冰豆网上搜索。

HFSS的近场仿真教学内容.docx

HFSS的近场仿真教学内容

HFSS的近场仿真

1、软件安装和破解

1)Hfss13只能安装在C盘。

2)破解时先在控制面板里关闭Windowsdefender并且退出360杀毒软件。

否则Ansoft2008fix.exe会被当病毒杀掉。

3)将Ansoft2008fix.exe和hfss12fix.exe和license.lic拷贝到HFSS13.0目录下。

4)以管理员身份运行Ansoft2008fix.exe。

5)以管理员身份运行hfss12fix.exe,连续patch六个dll。

6)打开hfss,弹出框框,无视继续。

依次点击TOOls-options-generaloptions-webupdateoptions-never

2、模型的建立

2.1设计变量

 

2.2画模型

 

 

 

 

2.3边界条件

 

2.4激励源

因为hfss算出的场强为正弦波波峰,所以输入功率有一个1/2的因子。

2.5加运算器

 

2.6画近场线

 

近场线要一一对应。

3、数据的导出

用AddTrace添加曲线到同一页面,用ApplyTrace改变频点。

导出为csv格式。

将横坐标反归一化。

画出三维曲面图。

4、用脚本画近场线

DimoAnsoftApp

DimoDesktop

DimoProject

DimoDesign

DimoEditor

DimoModule

SetoAnsoftApp=CreateObject("AnsoftHfss.HfssScriptInterface")

SetoDesktop=oAnsoftApp.GetAppDesktop()

SetoProject=oDesktop.GetActiveProject()

SetoDesign=oProject.GetActiveDesign()

SetoEditor=oDesign.SetActiveEditor("3DModeler")

'声明变量与常数.

Dimzpos,Xnum,Ynum,xspan,yspan,dx,dy,pos

DimUnits,index

Dimy()

Dimx()

Units="mm"

pos=6000

'-----------------------------3米x面----------------------------------------

Units=InputBox("Selecttheunits:

"&Chr(13)&_

"(cm,mm,um,in,mil)","Nearfield","mm",pos,pos)

zpos=InputBox("InputtheZplaneposition:

","Nearfield",3200,pos,pos)

xspan=InputBox("InputXsamplingspan:

","Nearfield",4000,pos,pos)

yspan=InputBox("InputYsamplingspan:

","Nearfield",2100,pos,pos)

Xnum=InputBox("InputsamplingnumberinXdirection:

","Nearfield",100,pos,pos)

Ynum=InputBox("InputsamplingnumberinYdirection:

","Nearfield",15,pos,pos)

 

Redimy(Ynum)

dx=xspan/(Xnum-1)

dy=yspan/(Ynum-1)

y(0)="Positionofy"

 

Forn=1ToYnum

y(n)=-yspan/2+(n-1)*dy

'将X向点坐标存入数组

ZValue=cstr(zpos)&Units

YValue=cstr(y(n))&Units

XValuemin=cstr(-xspan/2)&Units

XValuemmax=cstr(xspan/2)&Units

index="lin3mx"&cstr(n)

oEditor.CreatePolylineArray("NAME:

PolylineParameters","IsPolylineCovered:

=",true,"IsPolylineClosed:

=",_

false,Array("NAME:

PolylinePoints",Array("NAME:

PLPoint","X:

=",XValuemin,"Y:

=",YValue,"Z:

=",_

ZValue),Array("NAME:

PLPoint","X:

=",XValuemmax,"Y:

=",YValue,"Z:

=",ZValue)),_

Array("NAME:

PolylineSegments",Array("NAME:

PLSegment","SegmentType:

=",_

"Line","StartIndex:

=",0,"NoOfPoints:

=",2)),Array("NAME:

PolylineXSection","XSectionType:

=",_

"None","XSectionOrient:

=","Auto","XSectionWidth:

=","0mm","XSectionTopWidth:

=",_

"0mm","XSectionHeight:

=","0mm","XSectionNumSegments:

=","0","XSectionBendType:

=",_

"Corner")),Array("NAME:

Attributes","Name:

=",index,"Flags:

=","","Color:

=",_

"(132132193)","Transparency:

=",0,"PartCoordinateSystem:

=","Global","UDMId:

=",_

"","MaterialValue:

=",""&Chr(34)&"vacuum"&Chr(34)&"","SolveInside:

=",_

true)

namepara="NAME:

"&index

SetoModule=oDesign.GetModule("RadField")

oModule.InsertNearFieldLineSetupArray(namepara,"UseCustomRadiationSurface:

=",_

false,"Line:

=",index,"NumPts:

=",cstr(Xnum))

Next

 

'------------------------------3米y面---------------------------------------

 

Units=InputBox("Selecttheunits:

"&Chr(13)&_

"(cm,mm,um,in,mil)","Nearfield","mm",pos,pos)

zpos=InputBox("InputtheZplaneposition:

","Nearfield",3200,pos,pos)

xspan=InputBox("InputXsamplingspan:

","Nearfield",2100,pos,pos)

yspan=InputBox("InputYsamplingspan:

","Nearfield",4000,pos,pos)

Xnum=InputBox("InputsamplingnumberinXdirection:

","Nearfield",15,pos,pos)

Ynum=InputBox("InputsamplingnumberinYdirection:

","Nearfield",100,pos,pos)

 

Redimx(Xnum)

dx=xspan/(Xnum-1)

dy=yspan/(Ynum-1)

x(0)="Positionofx"

 

Forn=1ToXnum

x(n)=-xspan/2+(n-1)*dx

'将X向点坐标存入数组

ZValue=cstr(zpos)&Units

XValue=cstr(x(n))&Units

YValuemin=cstr(-yspan/2)&Units

YValuemmax=cstr(yspan/2)&Units

index="lin3my"&cstr(n)

oEditor.CreatePolylineArray("NAME:

PolylineParameters","IsPolylineCovered:

=",true,"IsPolylineClosed:

=",_

false,Array("NAME:

PolylinePoints",Array("NAME:

PLPoint","Y:

=",YValuemin,"X:

=",XValue,"Z:

=",_

ZValue),Array("NAME:

PLPoint","Y:

=",YValuemmax,"X:

=",XValue,"Z:

=",ZValue)),_

Array("NAME:

PolylineSegments",Array("NAME:

PLSegment","SegmentType:

=",_

"Line","StartIndex:

=",0,"NoOfPoints:

=",2)),Array("NAME:

PolylineYSection","YSectionType:

=",_

"None","YSectionOrient:

=","Auto","YSectionWidth:

=","0mm","YSectionTopWidth:

=",_

"0mm","YSectionHeight:

=","0mm","YSectionNumSegments:

=","0","YSectionBendType:

=",_

"Corner")),Array("NAME:

Attributes","Name:

=",index,"Flags:

=","","Color:

=",_

"(132132193)","Transparency:

=",0,"PartCoordinateSystem:

=","Global","UDMId:

=",_

"","MaterialValue:

=",""&Chr(34)&"vacuum"&Chr(34)&"","SolveInside:

=",_

true)

namepara="NAME:

"&index

SetoModule=oDesign.GetModule("RadField")

oModule.InsertNearFieldLineSetupArray(namepara,"UseCustomRadiationSurface:

=",_

false,"Line:

=",index,"NumPts:

=",cstr(Ynum))

Next

5、用脚本导出近场数据

DimoAnsoftApp

DimoDesktop

DimoProject

DimoDesign

DimoEditor

DimoModule

SetoAnsoftApp=CreateObject("AnsoftHfss.HfssScriptInterface")

SetoDesktop=oAnsoftApp.GetAppDesktop()

oDesktop.RestoreWindow

SetoProject=oDesktop.SetActiveProject("Project6")

SetoDesign=oProject.SetActiveDesign("HFSSDesign1")

SetoModule=oDesign.GetModule("ReportSetup")

'---------------------------------------3mx-0.8G--------------------------------------------------------

oModule.CreateReport"XYPlot27","NearFields","RectangularPlot",_

"Setup1:

Sweep",Array("Context:

=","lin3mx1"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx2"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx3"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx4"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx5"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx6"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx7"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx8"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx9"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx10"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx11"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx12"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx13"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx14"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

oModule.AddTraces"XYPlot27","Setup1:

Sweep",Array("Context:

=","lin3mx15"),Array("NormalizedDistance:

=",Array(_

"All"),Array("NAME:

VariableValues","Freq:

=","0.8GHz")),Array("XComponent:

=",_

"NormalizedDistance","YComponent:

=",Array("NearETotal")),Array()

 

oModule.ExportToFile"XYPlot27","C:

/Users/xiaoen/Documents/3mx-0.8G.csv"

oModule.DeleteReportsArray("XYPlot27")

 

'---------------------------------------3my-0.8G-------------------

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1