[chronojump] Added 1RM prediction. Badillo 2015



commit 11c4012cd799af6a43c4150218989f6e8aa81561
Author: Xavier Padullés <x padulles gmail com>
Date:   Mon Dec 19 11:05:48 2016 +0100

    Added 1RM prediction. Badillo 2015

 encoder/graph.R |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 73 insertions(+), 1 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index b227d26..9b487ee 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -1995,10 +1995,82 @@ paint1RMBadillo2010 <- function (paf, title, outputData1)
 
        segments(predicted1RM,0.185,predicted1RM,0,lty=1)
        mtext(side=1, at=predicted1RM, round(predicted1RM,2), cex=.8)
-                       
+
        write(paste("1RM;",round(predicted1RM,2),sep=""), SpecialData)
 }
 
+paint1RMBadilloSquat <- function (paf, title, outputData1)
+{
+        curvesLoadTotal = (paf[,findPosInPaf("Load","")])              #mass: X
+        curvesLoadExtra = (paf[,findPosInPaf("MassExtra","")])
+        curvesSpeed = (paf[,findPosInPaf("Speed", "mean")])    #mean speed Y
+        
+        par(mar=c(5,6,3,4))
+        
+        loadPercent <- seq(30,100, by=5)
+        
+        #msp: mean speed propulsive
+        msp <- c(1.33, 1.235, 1.145, 1.055, 0.965, 0.88, 0.795,
+                 0.715, 0.635, 0.555, 0.475, 0.405, 0.325, 0.255, 0.185)
+        #variation <- c(0.08, 0.07, 0.06, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.04, 0.04, 0.04, 0.04, 0.03, 
0.04)
+        
+        maxy=max(c(msp,curvesSpeed))
+        miny=min(c(msp,curvesSpeed))
+        
+        
+        loadPercentCalc <- -2.079*curvesSpeed^2 - 59.5*curvesSpeed + 120.5
+        #sometimes there's a negative value, fix it
+        for(i in 1:length(loadPercentCalc))
+                if(loadPercentCalc[i] < 0)
+                        loadPercentCalc[i] = NA
+        
+        loadCalcTotal <- 100 * curvesLoadTotal / loadPercentCalc
+        loadCalcExtra <- loadCalcTotal - (curvesLoadTotal - curvesLoadExtra)
+        
+        #for calculations take only the curves slower or == than 1.33
+        curvesSpeedInIntervalPos = which(curvesSpeed <= max(msp))
+        
+        if(length(curvesSpeedInIntervalPos) == 0) {
+                plot(0,0,type="n",axes=F,xlab="",ylab="")
+                text(x=0,y=0,translateToPrint("Not enough data."),cex=1.5)
+                dev.off()
+                write("1RM;-1", SpecialData)
+                write("", outputData1)
+                quit()
+        }
+        
+        par(mar=c(6,5,3,4))
+        
+        plot(curvesLoadExtra,curvesSpeed, type="p",
+             main=paste(title, "1RM", translateToPrint("prediction")),
+             sub=paste("\n",translateToPrint("Concentric mean speed on squat 1RM =")," 0.31m/s.",
+                       translateToPrint("Estimated percentual load ="),
+                       "-2.079 * ", translateToPrint("speed"), " ^2 - 59.5 * ", translateToPrint("speed"), " 
+ 120.5\n",
+                       translateToPrint("Adapted from")," Gonzalez-Badillo, Sanchez-Medina (2015)"),
+             xlim=c(min(curvesLoadExtra),max(loadCalcExtra[curvesSpeedInIntervalPos])),
+             ylim=c(miny,maxy), xlab="", ylab="",axes=T)
+        
+        mtext(side=1,line=2,"Kg")
+        mtext(side=2,line=3,paste(translateToPrint("Mean speed in concentric propulsive phase"),"(m/s)"))
+        mtext(side=4,line=2,"1RM (%)")
+        
+        abline(h=msp, lty=2, col="gray")
+        mtext(side=4,at=msp, paste(" ",loadPercent), las=2)
+        
+        colors=c(rep(NA,29),rev(heat.colors(100)[0:71]))
+        arrows(curvesLoadExtra,curvesSpeed,loadCalcExtra,0.185,code=2,col=colors[loadPercentCalc])
+        
+        closerValues = which(curvesLoadExtra == max(curvesLoadExtra))
+        segments(loadCalcExtra[closerValues],0.185,loadCalcExtra[closerValues],0,lty=3)
+        
+        predicted1RM = mean(loadCalcExtra[closerValues])
+        
+        segments(predicted1RM,0.185,predicted1RM,0,lty=1)
+        mtext(side=1, at=predicted1RM, round(predicted1RM,2), cex=.8)
+        
+        write(paste("1RM;",round(predicted1RM,2),sep=""), SpecialData)
+}
+
 #---- RM Indirect start ----
 
 RMIndirect <- function(Q, nrep) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]