# LaRoAwan CubeSat with an Adaptive Data Rate: An Experimental Analysis of Path Loss Link Margin
## 4 Methodology
### Theoretical Analysis  
#### 4.1.1 Orbit Geometry and Slant Range Analysis  
The positioning of LEO satellites is challenging because the satellite continually moves at a constant angular velocity when seen from an Earth point ground station. Before calculating the free space path loss from the satellite to the antenna, the distance between the satellite and the ground station antenna must first be determined. The topocentricreference frame is used to track in an arbitrary orbit from a point on the ground and usually requires the computation of quantities slant range azimuth and elevation [23]. Two approaches to computing these are cartesian geometry and spherical geometry. If the cartesian coordinates of the satellite in the Earth-Centered Fixed (ECEF) coordinate frame are denoted as \(x^{\prime}z^{\prime}y^{\prime}\) and the ground observer located at the longitude \(\lambda_{g}\) and latitude \(\Phi_{g}\), the cartesian coordinates of the ground observer will be denoted by Equations (1)-(3). Figure 2 shows the geometrical representation of the ground observer. \[x^{\prime}_{g}=r_{e}\ cos\[PERSON]_{g}\ cos\lambda_{g} \tag{1}\]  
\[y^{\prime}_{g}=r_{e}\ cos\Phi_{g}\ sin\lambda_{g} \tag{2}\]  
\[z^{\prime}_{g}=r_{e}\ sin\Phi_{g} \tag{3}\]  
Then the slant range vector from ground to spacecraft will be calculated by Equation (4). \[ \begin{bmatrix}p_{x}\\ p_{y}\\ p_{z}\end{bmatrix} = \begin{bmatrix}x^{\prime}-x^{\prime}_{g}\\ y^{\prime}-y^{\prime}_{g}\\ z^{\prime}-z^{\prime}_{g}\end{bmatrix}  \tag{4}\]  
To transform into topocentric coordinates \((x_{t},\ y_{t},\ z_{t})\), it is observed that the topocentric coordinates involve rotation along the \(z\) axis by angle \(\lambda_{g}\) and rotation along the \(y\) axis by angle \((90-\Phi_{g})\). Therefore, the coordinates can be calculated by Equation (5). \[ \begin{bmatrix}x_{t}\\ y_{t}\\ z_{t}\end{bmatrix} = \begin{bmatrix}sin\Phi_{g}\ cos\lambda_{g}\ \ sin\Phi_{g}\ sin\lambda_{g}&-cos\Phi_{g}\\ -sin\lambda_{g}\ cos\lambda_{g}\ \ 0\\ cos\Phi_{g}\ cos\lambda_{g}\ cos\Phi_{g}\ sin\lambda_{g}\ \ \ sin\Phi_{g}\end{bmatrix} \times \begin{bmatrix}p_{x}\\ p_{y}\\ p_{z}\end{bmatrix}  \tag{5}\]  
Hence, the slant range \(d\) can be calculated using Equation (6). \[d=\sqrt{p_{x}^{2}+p_{y}^{2}+p_{z}^{2}}=\sqrt{x_{t}^{2}+y_{t}^{2}+z_{t}^{2}} \tag{6}\]  
Also, azimuth and elevation angles are calculated using Equations (7) and (8). \[tan\ A_{Z}=\left(\frac{y_{t}}{x_{t}}\right) \tag{7}\]  
Figure 2: Cartesian coordinates geometry diagram of ground observer. \[tan\theta=\frac{z_{t}}{\sqrt{x_{t}^{2}+y_{t}^{2}}} \tag{8}\]  
In spherical geometry, local mean sidereal time, the angle of a ground station at latitude \(\lambda_{g}\) is the angle between the vernal equinox and \(\Phi_{g}\)_it_ measured positive towards the east. The geometry between the Earth station and the spacecraft \(p\) with sub-satellite point S is shown in Figure 3.  
The hour angle \(H\) of the satellite measured positive to the west is the relative longitude between \(E\) and \(S\). It is denoted as Equation (9):  
\[H=-\big{(}\lambda_{g}-\lambda_{g}\big{)}=-\Delta\lambda \tag{9}\]  
In Figure 3, the spherical triangle is redrawn to compute central angle \(\gamma\) subtended by circle arc ES, and the law of cosines is applied to the sides as shown in Equations (10) and (11). \[ \begin{array}{c}cos\gamma=cos(90-\delta)\ cos(90-\Phi g)+sin(90-\delta)\ sin(90-\Phi g)\ cos\Delta\lambda\\ =sin\Phi_{g}\ sin\delta+cos\Phi_{g}\ cos\delta\ cos\Delta\lambda\end{array}  \tag{10}\]  
Slant range can be determined by applying cosine laws to the plane triangle using Equation (11), as shown in Figure 4.  
\[d=\sqrt{R_{E}^{2}+r^{2}-2R_{E}r\ (sin\Phi_{g}\ sin\delta+cos\Phi_{g}cos\delta \ cos\Delta\lambda)} \tag{11}\]  
Figure 4: Slant range angle geometrical representation. Figure 3: Spherical geometry of Earth station and spacecraft sub-points. Hence the azimuth angle can be calculated using Equations (12) and (13).