資源簡介
matlab和hfss聯(lián)合仿真,如何將增益數(shù)據(jù)返回到matlab并輸出
代碼片段和文件信息
clc
clear?all
clear?f;clear?S;
clear?‘D:\Ansoft15\Temp\hfss20181015.aedt‘;
clear?‘D:\Ansoft15\Temp\mData20181015.m‘;
clear?‘D:\Ansoft15\Temp\tmp20181015.vbs‘;
clear?‘D:\Ansoft15\Temp\gData20181015.dat‘;
%添加程序包安裝路徑
addpath(‘E:\hfssapi\3dmodeler‘);
addpath(‘E:\hfssapi\boundary‘);
addpath(‘E:\hfssapi\analysis‘);
addpath(‘E:\hfssapi\general‘);
%frequency.c=波長*頻率
c=3e8;
%?solution?parameters?(GHz)
fSolve=3;
fStart=2;
fStop=4;
nPoints=50;
%dipole天線參數(shù)
lam=100*1e-3;
gap=0.24*1e-3;
length=0.48*lam;
dip_length=(length/2-gap/2)*1e-3;
dip_radius=(lam/200)*1e-3;
rad_radius=(dip_radius+lam/4)*1e-3;
rad_height=(length/2+lam/4)*1e-3;
%HFSS?Executable?Path
%?hfssExePath=?‘D:\hfss13\HFSS13.0\hfss.exe‘;
hfssExePath=?‘D:\Ansoft15\AnsysEM16.1\Win64\ansysedt.exe‘;
%?Optimization?stop?conditions.
Accuracy?=?0.01;%?accuracy?required?(1%).
disp(‘Creating?the?script?File?...‘);
tmpPrjFile?=?‘D:\Ansoft15\Temp\hfss20181015.aedt‘;
tmpDataFile?=?‘D:\Ansoft15\Temp\mData20181015.m‘;
tmpGainFile?=?‘D:\Ansoft15\Temp\gData20181015.m‘;
tmpscriptFile?=?‘D:\Ansoft15\Temp\tmp20181015.vbs‘;
fid?=?fopen(tmpscriptFile?‘wt‘);
%?creat?a?new?HFSS?project.
hfssNewProject(fid);
hfssInsertDesign(fid‘tmp20181015‘);
%偶極子天線的兩臂
hfssCylinder(fid‘dipole1‘‘Z‘?[000.12*1e-3]0.5*1e-323.88*1e-3‘meter‘);
hfssCylinder(fid?‘dipole2‘‘Z‘?[00-0.12*1e-3]0.5*1e-3-23.88*1e-3‘meter‘);
hfssAssignMaterial(fid‘dipole1‘‘pec‘);
hf
評論
共有 條評論