hw4 functions
This commit is contained in:
37
hw4.Rmd
37
hw4.Rmd
@@ -149,11 +149,12 @@ $\lambda_I$ in radians, $t$ in seconds.
|
||||
where $0 \leq t \leq 86 400$. Therefore:
|
||||
If $t \geq 86 400$, subtract $86 400$. If $t < 0$, add $86 400$.
|
||||
```{r klob-5}
|
||||
tGPS = 1 # TODO
|
||||
t = 43200 * lambda_I / pi + tGPS
|
||||
t <- function(tGPS){
|
||||
43200 * lambda_I / pi + tGPS
|
||||
}
|
||||
```
|
||||
```{r klob-5-demo}
|
||||
t
|
||||
t(1)
|
||||
```
|
||||
|
||||
### 6. Compute the amplitude of ionospheric delay
|
||||
@@ -188,10 +189,12 @@ P_I
|
||||
$$ X_I = \frac{2\pi ( t-50400)}{P_I}$$
|
||||
|
||||
```{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}
|
||||
X_I
|
||||
X_I(1)
|
||||
```
|
||||
|
||||
### 9. Compute the slant factor (ionospheric mapping function)
|
||||
@@ -214,15 +217,33 @@ I_1 = \begin{cases}
|
||||
$$
|
||||
|
||||
```{r klob-10}
|
||||
if (abs(X_I)< pi/2) {
|
||||
I_1 = (5e-9 + A_I * cos(X_I)) * F
|
||||
I_1 <- function(tGPS){
|
||||
if (abs(X_I(tGPS))< pi/2) {
|
||||
I_1 = (5e-9 + A_I * cos(X_I(tGPS))) * F
|
||||
}else{
|
||||
I_1 = 5e-9 * F
|
||||
}
|
||||
I_1
|
||||
}
|
||||
```
|
||||
|
||||
```{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
|
||||
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}
|
||||
head(ys)
|
||||
plot(xs,ys)
|
||||
```
|
||||
Reference in New Issue
Block a user