Skip to content
Snippets Groups Projects
Commit 0c7103b4 authored by Thomas Bock's avatar Thomas Bock :speech_balloon:
Browse files

new fit target fill

parent 1c38a0fa
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,10 @@
#' @keywords
#'
fn.filltarget <- function(p, a, b, c, d, e, f){
return((a+c*p+e*p^2+f*p^3)/(1+b*p+d*p^2))
}
ce3.pressure.target.fill<- function(p.target, gas="N2"){
maxIter <- 10
......@@ -41,14 +45,21 @@ ce3.pressure.target.fill<- function(p.target, gas="N2"){
}else{
prefix <- paste(lw, "_", gas, "_", sep="")
sufix <- ""
p.pred <- fn.2162(ce3doc, prefix, sufix, p.fill) / C1 * p.fill
a <- getConstVal(sl, paste0(prefix, "A", sufix))
b <- getConstVal(sl, paste0(prefix, "B", sufix))
c <- getConstVal(sl, paste0(prefix, "C", sufix))
d <- getConstVal(sl, paste0(prefix, "D", sufix))
e <- getConstVal(sl, paste0(prefix, "E", sufix))
f <- getConstVal(sl, paste0(prefix, "F", sufix))
p.pred <- fn.filltarget(p.fill, a, b, c, d, e, f) / C1 * p.fill
e <- p.pred/p.target - 1
iter <- 1
while((abs(e) > 1e-4) | iter == maxIter ){
e <- p.pred/p.target - 1
p.fill <- p.fill * (1 - e)
p.pred <- fn.2162(ce3doc, prefix, sufix, p.fill)/C1 * p.fill
p.pred <- fn.filltarget(p.fill, a, b, c, d, e, f)/C1 * p.fill
iter <- iter + 1
}
}
......
......@@ -7,7 +7,7 @@ resSens <- function(ccc){
## pcal
##-------------##
PCAL <- getSubList(a$cav$Pressure, "cal")
PCAL$HeadCell <- "{\\(p_{cal}\\)}"
PCAL$HeadCell <- "{\\(p_\\text{cal}\\)}"
PCAL$UnitCell <- paste("{in", PCAL$Unit, "}")
pcal <- getConstVal(NA, NA, PCAL)
......@@ -26,14 +26,14 @@ resSens <- function(ccc){
## ind
##-------------##
PIND <- getSubList(a$cav$Pressure, "ind")
PIND$HeadCell <- "{\\(I_{C}\\)}"
PIND$HeadCell <- "{\\(I_\\text{C}\\)}"
PIND$UnitCell <- paste("{in", PIND$Unit, "}")
pind <- getConstVal(NA, NA, PIND)
##-------------##
## ind_offset
##-------------##
PINDoffs <- getSubList(a$cav$Pressure, "ind_offset")
PINDoffs$HeadCell <- "{\\(I_{R}\\)}"
PINDoffs$HeadCell <- "{\\(I_\\text{R}\\)}"
PINDoffs$UnitCell <- paste("{in", PINDoffs$Unit, "}")
pindoffs <- getConstVal(NA, NA, PINDoffs)
......@@ -41,7 +41,7 @@ resSens <- function(ccc){
## ind_corr
##-------------##
PINDcorr <- getSubList(a$cav$Pressure, "ind_corr")
PINDcorr$HeadCell <- "{\\(I_{C} - I_{R}\\)}"
PINDcorr$HeadCell <- "{\\(I_\\text{C} - I_\\text{R}\\)}"
PINDcorr$UnitCell <- paste("{in", PINDcorr$Unit, "}")
pindcorr <- getConstVal(NA, NA, PINDcorr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment