0
$\begingroup$
pmv1=function(H,pa,Ta,fcl,Tr,Iclo,M){

Tcl = (35.7 - 0.0275*H + 0.155*Iclo* (H - 0.31*(57.4 - 0.07*H - pa) - 
      0.42*(H - 58) - 0.0017*M*(58.7 - pa) - 0.0014*M*(34 - Ta)))

hc=(2.4*(Tcl - Ta))

dT= (Tr - 22)   

PMV= (4 + (0.303 *exp(-.036*H) + 0.0275)* (6.57 + 0.46*H +.31*pa + 0.0017*H*pa + 
      0.0014*H*Ta - 4.13 *fcl *(1 + 0.01*dT)*(Tcl - Tr)-hc*fcl *(Tcl - Ta)))


  return((PMV-min(PMV))*3/(max(PMV)-min(PMV))-0)

}


----------
d=7

n <- 250

set.seed(0)

X1 <- optimumLHS(n, d)

X1 <- data.frame(X1)

colnames(X1) <- c("H","pa","Ta","fcl","Tr","Iclo","M")

apply(X1, 1,pmv1)

Error in FUN(newX[, i], ...) : argument "Iclo" is missing, with no default

$\endgroup$
  • $\begingroup$ can you help to share actual formula, PMV= (4 + (0.303 *exp(-.036*H) + 0.0275)* (6.57 + 0.46*H +.31*pa + 0.0017*H*pa + 0.0014*H*Ta - 4.13 *fcl *(1 + 0.01*dT)(Tcl - Tr)-hcfcl *(Tcl - Ta))) $\endgroup$ – Toros91 Nov 23 '17 at 6:37
0
$\begingroup$

This is the answer:

pmv1 = function(H,pa,Ta,fcl,Tr,Iclo,M){
  Tcl = (35.7 - 0.0275*H + 0.155*Iclo * 
           (H - 0.31*(57.4 - 0.07*H - pa) - 
              0.42*(H - 58) - 0.0017*M*(58.7 - pa) - 
              0.0014*M*(34 - Ta)))

  hc=(2.4*(Tcl - Ta))
  dT= (Tr - 22)

  PMV= (4 + (0.303 *exp(-.036*H) + 0.0275)* 
          (6.57 + 0.46*H +.31*pa + 0.0017*H*pa + 0.0014*H*Ta - 4.13 *fcl 
           *((1 + 0.01*dT) * (Tcl - Tr))-fcl *(Tcl - Ta)))
  return((PMV-min(PMV))*3/(max(PMV)-min(PMV))-0)
}

d <- 7

n <- 250

set.seed(0)

X1 <- optimumLHS(n, d)
X1 <- data.frame(X1)

#colnames(X1) <- c("H","pa","Ta","fcl","Tr","Iclo","M")
new <- pmv1(X1[,1],X1[,2],X1[,3],X1[,4],X1[,5],X1[,6],X1[,7])

This would do the job.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thnaks a lot @Toros91 it worked, you are a big help $\endgroup$ – Mithun Ghosh Nov 23 '17 at 18:29
  • $\begingroup$ No problem!, I’ve answered the other question too. If you got what you want, please accept the answer. $\endgroup$ – Toros91 Nov 24 '17 at 0:26
  • $\begingroup$ If the code was helpful, +1 would be appreciated. $\endgroup$ – Toros91 Jan 23 '18 at 6:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.