Skip to content
Snippets Groups Projects
Commit 863b92b0 authored by wactbprot's avatar wactbprot
Browse files

abstrah. aufr.

parent 1d347229
Branches
No related tags found
No related merge requests found
library(ggplot2)
### --------------------------------------------------------
p.fill <- 44.6 # mbar
M <- 100 # Anz. Messpunkte pro SZ
idx <- seq(1, M)
dyn <- 1.6e-3
p.mean.sz <- c(0,
0,
0,
0) # mbar
p.D <- dyn * p.fill
p.d <- - p.D / M
p.rand.sd <- abs(p.D / 10)
p.upper <- p.mean.sz + p.D / 2
p.lower <- p.mean.sz - p.D / 2
m.sz <- c(-1.8e-3,
-1.8e-3,
-1.8e-3,
-1.8e-3,
-1.8e-3) # mbar/s
t.d <- p.d / m.sz
t.rand.sd <- t.d * 1e-3
N <- length(p.mean.sz) # Anzahl der SZ
p.fill <- 44.6 # mbar
M <- 100 # Anz. Messpunkte pro SZ
N <- 5 # Anz. der SZ
p.mean <- 0.0 # mbar
m.mean <- -1.8e-3 # mbar/s
t.rand.sd.rel <- 1e-3
p.rand.sd.rel <- 1e-3
p.mean.sz <- rep(p.mean, N) # Druckmittelwert der SZ
m.sz <- rep(m.mean, N) # Ausgangssteigung der SZ
idx <- seq(1, M)
dyn <- 1.6e-3 # relativer hub der SZ
p.D <- dyn * p.fill
p.d <- -p.D / M
p.upper <- p.mean.sz + p.D / 2
p.lower <- p.mean.sz - p.D / 2
t.d <- p.d / m.sz
t.rand.sd <- abs(t.d * t.rand.sd.rel)
p.rand.sd <- abs(p.fill * t.rand.sd.rel)
## neue knstliche SZs
## erzeugen
......@@ -47,10 +40,10 @@ for(i in 1:N){
}else{
t.new[i,] <- t.new[i-1, M] + t.d[i] * idx
}
p.new[i,] <- seq(p.upper[i],
p.lower[i],
length.out = M)
length.out = M)
p.rand[i,] <- p.new[i,] + rnorm(M, 0, p.rand.sd)
t.rand[i,] <- t.new[i,] + rnorm(M, 0, t.rand.sd)
......@@ -58,14 +51,13 @@ for(i in 1:N){
temp.lm <- lm( p.rand[i,] ~ t.rand[i,])
c.rand[i] <- coefficients(temp.lm)[1]
m.rand[i] <- coefficients(temp.lm)[2]
}
}
pt.df <- data.frame(p.new = as.vector(p.new),
t.new = as.vector(t.new),
p.rand = as.vector(p.rand),
t.rand = as.vector(t.rand))
t.new = as.vector(t.new),
p.rand = as.vector(p.rand),
t.rand = as.vector(t.rand))
ggplot(pt.df) +
......@@ -73,5 +65,3 @@ ggplot(pt.df) +
geom_point(aes(x = t.rand, y = p.rand), color='red') +
geom_abline(aes(intercept = c.rand, slope = m.rand), color='red') +
ggtitle("dp vs. dt")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment