hw4
This commit is contained in:
9
hw4.Rmd
9
hw4.Rmd
@@ -201,6 +201,7 @@ X_I(1)
|
||||
$$ F=\left[1 - (\frac{R_E}{R_E + h} \cos E)^2\right]^{-1/2} $$
|
||||
|
||||
```{r klob-9}
|
||||
# with the given input this becomes constant 1 due to FP inaccuracies
|
||||
F = (1- (R_E/(R_E+h) * cos(E) )^2)^(-1/2)
|
||||
```
|
||||
|
||||
@@ -219,11 +220,11 @@ $$
|
||||
```{r klob-10}
|
||||
I_1 <- function(tGPS){
|
||||
if (abs(X_I(tGPS))< pi/2) {
|
||||
I_1 = (5e-9 + A_I * cos(X_I(tGPS))) * F
|
||||
I = (5e-9 + A_I * cos(X_I(tGPS))) * F
|
||||
}else{
|
||||
I_1 = 5e-9 * F
|
||||
I = 5e-9 * F
|
||||
}
|
||||
I_1
|
||||
I
|
||||
}
|
||||
```
|
||||
|
||||
@@ -245,6 +246,6 @@ for (x in xs){
|
||||
|
||||
```{r simulate-demo, echo=FALSE}
|
||||
head(ys)
|
||||
plot(xs,ys,xlab="Time of Day [Minutes]",ylab="Delay [s]")
|
||||
plot(xs[-length(xs)],ys[-length(xs)],xlab="Time of Day [Minutes]",ylab="Delay [s]")
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user