Computer Science and Application 计算机科学与应用, 2019, 9(4), 790-801Published Online April 2019 in Hans. /journal/csahttps:///10.12677/csa.2019.94090Sun Shadow Positioning Model Basedon MATLAB SimulationZhe Wang, Jifa Zhang, Zhuang WangSchool of Electronic Information, Qingdao University, Qingdao ShandongReceived: Apr. 9th, 2019; accepted: Apr. 19th, 2019; published: Apr. 26th, 2019AbstractIn this paper, aiming at the problem of sun shadow localization, by analyzing and calculating the parameters affecting the shadow length of the object, the rod length optimization model based on multi-parameter hierarchical search is established with the aim of inversion of the rod length, and the MATLAB simulation is used to realize the sun shadow positioning technology. Firstly, a straight-line shadow length variation model based on the change of solar height angle is estab-lished, and the relationship between the straight shadow length and the declination angle and the time angle is obtained. Secondly, the control variable is used to analyze the length of the straight rod. Using the method of control variable to analyze the variation rule of longitude, latitude, mea-surement date and measurement time and the curve of the straight shadow length from 9:00 to 15:00 (Beijing time), it is found that the shadow length decreases first and then increases at 11:45.The minimum value obtained is about 2.1. Finally, the model is tested by the actual measurement method, the error of the model result relative to the actual measured value is about 1.732%, and the model has higher precision. For the shadow localization problem, the relationship between the straight shadow length and the shadow vertex coordinate value is obtained through the geometric relationship. For the case where the straight rod location is unknown, this paper applies the long length of the shadow length and the solar elevation angle inversion at the same place. Based on the principle of the parameter, the pole length optimization model based on parameter hierarchical search is established, and the range of the poles in the same group is approximated to zero. The MATLAB is used to perform rough search and fine search on the longitude and latitude. The feasi-ble longitude and latitude values are (108.4566˚E, 19.2771˚N) and (103.1670˚E, 3.2552˚S). The first group of latitude and longitude corresponds to the offshore area of Hainan Province, and its longitude and longitude error of Hainan Province is 1.256%. Therefore, the first location is desig-nated as Hainan Province within the error tolerance. The second group of latitude and longitude corresponds to Indonesia.KeywordsMATLAB Simulation, Sun Shadow Localization, Hierarchical Search, Single Target Optimization基于MATLAB仿真的太阳影子定位模型王者,张吉发,王壮王者 等青岛大学电子信息学院,山东 青岛收稿日期:2019年4月9日;录用日期:2019年4月19日;发布日期:2019年4月26日摘 要 本文针对太阳影子定位问题,通过对影响物体影长的各个参数进行分析计算,以反演杆长最优为目标建立基于多参数分层搜索的杆长优化模型,利用MATLAB 仿真从而实现太阳影子定位技术。
首先建立基于太阳高度角变化的直杆影长变化模型,得到直杆影长与赤纬角、时角等变量的函数关系式;其次,运用控制变量的方法分析影长关于直杆长度、所处经度、纬度、测量日期以及测量时间的变化规律并作出2018年9时至15时(北京时间)的直杆影长变化曲线,发现影长随时间的推移先减小后增大,在11时45分取得最小值约为2.1 m ;最后,本文通过实际测量的方法对模型进行检验,得到模型结果相对实际测量值的误差约为1.732%,模型有较高的精度。
对于影子定位问题,通过几何关系得出直杆影长与影子顶点坐标数值的关系;针对直杆所在地点未知的情况,本文应用同一地点不同时刻的影长和太阳高度角反演得到的杆长相等的原理建立起基于参数分层搜索的杆长优化模型,以同一地点多组杆长值中极差近似为零为目标;利用MATLAB 对经度和纬度先后进行粗搜索和精搜索,得到两组可行经纬值分别为:(108.4566˚E, 19.2771˚N)及(103.1670˚E, 3.2552˚S);第一组经纬度对应位置为近海南省的海上,其经度与海南省经度误差为1.256%,所以本文在误差允许范围内将第一个地点定为海南省,第二组经纬度对应位置为印度尼西亚。
关键词MATLAB 仿真,太阳影子定位,分层搜索,单目标优化Copyright © 2019 by author(s) and Hans Publishers Inc.This work is licensed under the Creative Commons Attribution International License (CC BY)./licenses/by/4.0/1. 引言 通过物体影子变化情况得到物体具体所在位置以实现“太阳影子定位”是定位分析非常重要的一个方面。
某物体的影子与该物体长度以及所在位置的太阳高度角有关,太阳高度角主要由物体所处经纬度,日期等决定。
本文建立物体影长变化模型,进而提出基于多参数分层搜索的杆长优化模型,进而利用MATLAB 进行仿真得到较好的结果;本文利用实际测量当地某位置直杆影长的方法对模型进行检验。
本文研究问题具有一定的实用价值,利用MATALB 进行计算机仿真很好地提高了模型计算效率和精度,并且模型检验方法具有较好的操作性以及实际价值。
2. 太阳影长变化模型2.1. 影长变化模型本文以直杆作为研究载体探究直杆影长与各种因素的关系,直杆与其在地面投影的几何关系如图1所示:Open Access王者 等Figure 1. Straight shot projection geometry图1. 直杆投影几何示意图Figure 2. Geometry of declination and time angles图2. 赤纬角和时角几何示意图就固定在地面某一点的直杆而言,其投影点位置与太阳高度角有关,影子长度l 为tan H α,其中,H 为直杆长度,α为太阳高度角。
地球某点处的太阳高度角α取决于该地的纬度ϕ,某确定时刻太阳赤纬角D 以及太阳时角h ,其几何关系如图2所示。
太阳高度角解析关系式关系如式(1)所示:()arcsin sin sin cos cos cosh D D αϕϕ=+ (1)首先,本文进行太阳赤纬角的推导[1],赤纬角D 有:sin sin 232637.8sin D σ′′′= (2)其中[2]:279.9348 1.914827sin 0.079525cos 0.019938sin 20.001620cos 2d d d d dδ=++−+− (3) d 为一年中特定日期表示的角分数,有: ()1360365.242n d −×= (4)其中,n 为某日期的积日,积日为日期在年内的序列号,如1月1日的积日为1,以此类推。