hw4 functions
This commit is contained in:
40
hw4.Rmd
40
hw4.Rmd
@@ -149,11 +149,12 @@ $\lambda_I$ in radians, $t$ in seconds.
|
|||||||
where $0 \leq t \leq 86 400$. Therefore:
|
where $0 \leq t \leq 86 400$. Therefore:
|
||||||
If $t \geq 86 400$, subtract $86 400$. If $t < 0$, add $86 400$.
|
If $t \geq 86 400$, subtract $86 400$. If $t < 0$, add $86 400$.
|
||||||
```{r klob-5}
|
```{r klob-5}
|
||||||
tGPS = 1 # TODO
|
t <- function(tGPS){
|
||||||
t = 43200 * lambda_I / pi + tGPS
|
43200 * lambda_I / pi + tGPS
|
||||||
|
}
|
||||||
```
|
```
|
||||||
```{r klob-5-demo}
|
```{r klob-5-demo}
|
||||||
t
|
t(1)
|
||||||
```
|
```
|
||||||
|
|
||||||
### 6. Compute the amplitude of ionospheric delay
|
### 6. Compute the amplitude of ionospheric delay
|
||||||
@@ -188,10 +189,12 @@ P_I
|
|||||||
$$ X_I = \frac{2\pi ( t-50400)}{P_I}$$
|
$$ X_I = \frac{2\pi ( t-50400)}{P_I}$$
|
||||||
|
|
||||||
```{r klob-8}
|
```{r klob-8}
|
||||||
X_I = (2 * pi * (t-50400))/P_I
|
X_I <- function(tGPS){
|
||||||
|
(2 * pi * (t(tGPS)-50400))/P_I
|
||||||
|
}
|
||||||
```
|
```
|
||||||
```{r klob-8-demo, echo=FALSE}
|
```{r klob-8-demo, echo=FALSE}
|
||||||
X_I
|
X_I(1)
|
||||||
```
|
```
|
||||||
|
|
||||||
### 9. Compute the slant factor (ionospheric mapping function)
|
### 9. Compute the slant factor (ionospheric mapping function)
|
||||||
@@ -214,15 +217,34 @@ I_1 = \begin{cases}
|
|||||||
$$
|
$$
|
||||||
|
|
||||||
```{r klob-10}
|
```{r klob-10}
|
||||||
if (abs(X_I)< pi/2) {
|
I_1 <- function(tGPS){
|
||||||
I_1 = (5e-9 + A_I * cos(X_I)) * F
|
if (abs(X_I(tGPS))< pi/2) {
|
||||||
}else{
|
I_1 = (5e-9 + A_I * cos(X_I(tGPS))) * F
|
||||||
|
}else{
|
||||||
I_1 = 5e-9 * F
|
I_1 = 5e-9 * F
|
||||||
|
}
|
||||||
|
I_1
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```{r klob-10-demo, echo=FALSE}
|
```{r klob-10-demo, echo=FALSE}
|
||||||
I_1
|
I_1(1)
|
||||||
```
|
```
|
||||||
The delay $I_1$ is given in seconds and is referred to the GPS L1 or
|
The delay $I_1$ is given in seconds and is referred to the GPS L1 or
|
||||||
Beidou B1 frequencies.
|
Beidou B1 frequencies.
|
||||||
|
|
||||||
|
# 24-hour simulation
|
||||||
|
```{r simulate}
|
||||||
|
xs <- seq(from = 0, to = 24*60, by = 1)
|
||||||
|
ys <- numeric(length(xs))
|
||||||
|
for (x in xs){
|
||||||
|
y <- I_1(x*60)
|
||||||
|
ys[x] <- y
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```{r simulate-demo, echo=FALSE}
|
||||||
|
head(ys)
|
||||||
|
plot(xs,ys,xlab="Time of Day [Minutes]",ylab="Delay [s]")
|
||||||
|
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user