1、Matlab与STK连接函数库最新整理Matlab与STK连接函数库(最新整理)Matlab与STK连接函数库整理者:龚德仁2008年10月7日一、Matlab/Simulink、STK联合仿真的优势STK/MATLAB,SIMULINK STK与Matlab联合实现可视化仿真集成,该方案可以适用于航空航天、航海、作战模拟、电子对抗、卫星导航定位、遥感遥测、卫星通信等各个可视化仿真集成案例之中。STK/MATLAB接口为STK和MATLAB提供了双向通讯功能,在MATLAB工作区通过Connect模块以TCP/IP协议打开STK端口。 利用超过150个MATLAB命令增强STK的轨道、弹道、轨
2、迹的分析能力,MexConnect还提供在MATLAB命令行直接使用任意 STK/Connect 命令的功能。MexConnect工具可以建立各种不同级别的STK对象,进行操作并生成报告。所有STK的数据,包括动态位置、速度和姿态数据,可以返 回到MATLAB工作空间,用于数学分析。宇航工具箱让MATLAB用户可以输出多重坐标系,以及符合STK格式的星历和姿态文件用于VO模块的三维可视 化。另外此工具还可以使用STK附加模块的功能如STK/COMM(通信),STK/Coverage (覆盖)和STK/Radar(雷达)。表1 STK模块基本模块基本版专业版三维显示高级三维显示Satellite
3、 Tool Kit(STK)STK/Professioal(STKPRO)STK/Visualization Option(STK/VO)STK/Advanced VO分析模块轨道机动链路分析通信分析接近分析覆盖分析拦截飞行工具导弹飞行工具精确定轨雷达分析空间环境STKAstrogatorSTKChainsSTKCommSTKConjunction Analysis ToolsSTKCoverageSTKInterceptor Flight Tool(IFT)STKMissile Flight Tool(MFT)STKPrecision Orbit DeterminationSystem(PO
4、DS)STKRadarSTKSpace Environment综合数据高精度数字地图高分辨率地球影像雷达高级环境全球三维地形STKHigh Resolution MapsSTKVO Earth ImagerySTKRadar Advanced Environment(RAE)STKTerrain扩展与接口连接模块网络实时播放MATlLAB接口分布式仿真地理信息接口程序开发库STKConnect and STKServerSTKWebCastSTKMATLAB InterfaceSTKDistributed Interactive Simulation(DIS)STKGeographic Inf
5、ormationSystems(GIS)STKProgrammers Library(PL)二、mexConnect函数详细介绍2.1 STK服务器命令(STK Server Commands)2.1.1 stkDefaultConID 作用:返回STK的默认标识2.1.2 stkDefaultHost作用:返回STK的默认地址2.1.3 stkSetDefaultHost作用:设置STK的新地址用法:stkSetDefaultHost(host:port)2.2 应用命令(Application Commands)2.2.1 stkAutoSave作用:自动保存STK用法:stkAutoSa
6、ve(onOff,directory, period) stkAutoSave(onOff)说明:onOff - on or off directory - string pathname of autosave directory period - seconds between saves2.2.2 stkHomeDir作用:返回STK的安装路径用法:dir = stkHomeDir2.2.3 stkCurrentDir作用:返回STK的当前路径用法:dir = stkHomeDir2.2.4 stkSetCurrentDir作用:设置STK的当前路径用法:stkSetCurrentDir
7、(directory)2.2.5 stkObjNames作用:返回STK中对象的名字用法:objNames = stkObjNames objNames = stkObjNames(classCell)说明:classCell - optional cell array of STK class names. objNames - cell array of STK object names 2.2.4 stkSetCurrentDir 2.2.6 stkTimerStart作用:启动计时器用法:stkTimerStart2.2.7 stkTimer作用:返回计时器时间用法:split, to
8、tal = stkTimer说明:split - elapsed time since last stkTimer command total - elapsed time since last stkTimerStart command2.3 普通对象命令(Generic Object Commands)2.3.1 stkCentralBody作用:返回坐标系的中心体用法:centBody = stkCentralBody(objPath)说明:objPath - String name of object obtained from stkObjNames. If ommitted, th
9、e scenario central body is returned. centBody - String name of object coordinate system central body.备注:更多内容参见stkObjNames、aeroToolbox。2.3.2 stkLoadObj作用:导入对象文件用法:stkLoadObj(parentPath, class, fileName) stkLoadObj(scenarioFileName)说明:parentPath - Valid path, may be obtained from stkObjNames. class -
10、Valid class name. Consult STK documentation for a list of valid classes. Names are case-sensitive. fileName - File path of object file 2.3.3 stkSaveObj作用:将对象保存用法:stkSaveObj(objPath, dirName) stkSaveObj(objPath)说明:objPath - Valid path, may be obtained from stkObjNames. dirName - Directory path of obj
11、ect file. When omitted, the default directory is used.2.3.4 stkNewObj 作用:创建一个新对象用法:stkNewObj(parentPath, class, name)说明:parentPath - Valid path, may be obtained from stkObjNames. class - Valid class name. Consult STK documentation for a list of valid classes. Names are case-sensitive. name - Name of
12、 new object备注:创建场景时,语法为stkNewObj(Scenario, ,Scenario1)2.3.5 stkUnload作用:卸载对象用法:stkUnload(objPath)说明:objPath - Valid path, may be obtained from stkObjNames.2.3.6 stkUnloadChildren作用:卸载对象的所有子对象用法:stkUnloadChildren (objPath)说明:objPath - Valid path, may be obtained from stkObjNames.2.3.7 stkRename作用:将对象
13、重命名用法:stkRename(objPath, newName)说明:objPath - Valid path, may be obtained from stkObjNames. newName - New instance name.2.3.8 stkTimePeriod作用:获取对象起止时间用法:timePeriod = stkTimePeriod(dateFormat) timePeriod = stkTimePeriod(objPath, dateFormat)说明: objPath - Valid vehicle object path, defaults to scenario
14、 path.timePeriod - Structure array with start and stop fields. Each field contains a string date value.dateFormat - Valid date format. Options are: EPOCHSEC EPOCHSECOND EPOCHMIN EPOCHMINUTE EPOCHHR EPOCHHOUR EPOCHDAY GMT ZULU GMTSYSTEM GREGLCL GREGORIANLOCAL GREGORIANLCL GREGUTC GREGORIANUTC GREGTAI
15、 GREGORIANTAI GREGTDT GREGORIANTDT GREGGPSTIME GREGGPS GREGORIANGPSTIME GPSTIME GPS JULDATE JULIANDATE JULLCL JULIANLOCAL JULIANLCL JULUTC JULIANUTC JUL4 JULIAN4 JULIAN4UTC JDATEOFF JDATEOFFSET JULDATEOFFSET JULEPHEMDATE JULIANEPHEMERISDATE JULIANEPHEM JULTAI JULIANTAI MISELAP MISSIONELAPSED MODJULD
16、ATE MODIFIEDJULIANDATE YYDDD YYDDD.DDD YYYYDDD YYYYDDD.HHMMSS YYYYMMDD YYYYMMDD.DDD YYYY/MM/DDTIME YYYY/MM/DD 备注:更对内容参见stkConvertDate、stkObjNames2.3.9 stkTimePeriodInSec作用:获取对象起止时间,以s为单位用法:start, stop = stkTimePeriodInSec(objPath) start, stop = stkTimePeriodInSec说明:objPath - valid object path, see s
17、tkObjNames. When not provided, the scenario time period is returned. start, stop - time in seconds2.3.10 stkValidObj作用:检查对象的有效性用法:result = stkValidObj(path)说明:path - object path name result - 1 if valid, 0 otherwise2.3.11 stkDescrip作用:获取对象的描述用法:description = stkDescrip(objPath, shortLong)说明:objPath
18、- Valid path, may be obtained from stkObjNames. shortLong - Type of description to get, short or long.2.3.12 stkSetDescrip作用:设置对象的描述用法:stkSetDescrip(objPath, shortLong, description)说明:objPath - Valid path, may be obtained from stkObjNames. shortLong - Type of description to set, short or long. descr
19、iption - Description text.2.4 场景命令(Scenario Commands)2.4.1 stkAnimTime作用:返回当前动画时间用法:time = stkAnimTime说明:time - current STK animation time (sec)2.4.2 stkEpoch作用:返回当前场景历元用法:epoch = stkEpoch(dateFormat)说明:dateFormat - Valid date format.epoch - string representation of scenario epoch. 2.4.3 stkSetEpoch
20、作用:设置场景历元用法:stkSetEpoch(epoch, dateFormat)说明:dateFormat - Valid date format.epoch - string representation of scenario epoch.2.4.4 stkSetEpochInSec作用:设置场景历元用法:stkSetEpochInSec(newEpoch)说明:newEpoch - number of seconds elapsed between current epoch and the desired epoch.2.4.5 stkSyncEpoch作用:aeroToolbox
21、与STK场景有同样的历元用法:stkSyncEpoch备注:STK and aeroToolbox maintain separate scenario epochs. This function should be called anytime the STK epoch is changed through mexConnect or via the STK GUI.2.4.6 stkConvertDate作用:转换日期格式用法:newDate = stkConvertDate(date, format, newFormat)2.4.7 stkSetTimePeriod作用:设置场景或卫星
22、的时间周期用法:stkSetTimePeriod(start, stop, dateFormat) stkSetTimePeriod(satpath, start, stop, dateFormat)说明:satpath - satellite path name, defaults to scenario start, stop - string dates2.4.8 stkSetTimePeriodInSec作用:设置场景的时间周期用法:stkTimePeriodInSec(start, stop)说明:start, stop - time in seconds2.4.9 stkScenF
23、ilePath作用:返回场景文件的路径用法:path = stkScenFilePath说明:path - current STK scenario directory2.4.10 stkValidScen作用:检查可用的场景用法:result = stkValidScen说明:result - 1 if valid, 0 otherwise2.5 基本飞行器数据(Basic Vehicle Data)2.5.1 stkTimePeriod作用:获取对象的时间周期用法:timePeriod = stkTimePeriod(dateFormat) timePeriod = stkTimePeri
24、od(objPath, dateFormat)说明:objPath - Valid vehicle object path, defaults to scenario path. timePeriod - Structure array with start and stop fields. Each field contains a string date value.2.5.2 stkTimePeriodInSec作用:获取对象的时间周期用法:start, stop = stkTimePeriodInSec(objPath) start, stop = stkTimePeriodInSec
25、说明:objPath - valid object path, see stkObjNames. When not provided, the scenario time period is returned. start, stop - time in seconds2.5.3 stkSetTimePeriod作用:设置场景或对象的时间周期用法:stkSetTimePeriod(start, stop, dateFormat) stkSetTimePeriod(satpath, start, stop, dateFormat)说明:satpath - satellite path name,
26、 defaults to scenario start, stop - string dates2.6 卫星运动属性(Satellite Propagators)2.6.1 stkSetPropCart作用:设置笛卡尔坐标系下卫星运动的参数用法:stkSetPropCart(objPath, propagator, coordSystem, . tStart, tStop, dt, orbitEpoch, pos, vel, coordEpoch)说明:objPath - Valid path, may be obtained from stkObjNames. propagator - Tw
27、oBody, J2Perturbation, J4Perturbation, HPOP or PODS This parameter is case sensitive! coordSystem - string name of coordinate system, valid choices are: Fixed, J2000, MeanOfDate, MeanOfEpoch, TrueOfDate, TrueOfEpoch, B1950, TEMEOfDate, TEMEOfEpoch, AlignmentAtEpoch. This parameter is case sensitive!
28、 tStart, tStop - times in epoch seconds. dt - time step in seconds. orbitEpoch - reference time of orbit data, in scenario epoch seconds pos - 3x1 vector of positions at reference time, meters vel - 3x1 vector of velocity at reference time, meters/sec coordEpoch - coordinate system epoch, required b
29、y all .OfEpoch coordinate systems.2.6.2 stkSetPropClassical作用:设置经典轨道根数描述下卫星运动的参数用法:stkSetPropClassical(objPath, propagator, coordSystem, . tStart, tStop, dt, orbitEpoch, semimajorAxis, eccentricity,. inclination, argOfPerigree, RAAN, meanAnomaly, coordEpoch)说明:objPath - Valid path, may be obtained f
30、rom stkObjNames. propagator - TwoBody, J2Perturbation, J4Perturbation, HPOP or PODS This parameter is case sensitive! coordSystem - string name of coordinate system, valid choices are: Fixed, J2000, MeanOfDate, MeanOfEpoch, TrueOfDate, TrueOfEpoch, B1950, TEMEOfDate, TEMEOfEpoch, AlignmentAtEpoch. This parameter is case sensitive!
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1