[chronojump] export sprintDynamics with encoder Sprint
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] export sprintDynamics with encoder Sprint
- Date: Tue, 24 Apr 2018 16:28:41 +0000 (UTC)
commit cd7eabc9ce2690bd5fbf7819563e466d31f0c359
Author: Xavier Padullés <x padulles gmail com>
Date: Tue Apr 17 16:35:51 2018 +0200
export sprintDynamics with encoder Sprint
r-scripts/sprintEncoder.R | 1 +
r-scripts/sprintPhotocells.R | 25 +------------------------
r-scripts/sprintUtil.R | 27 +++++++++++++++++++++++++++
3 files changed, 29 insertions(+), 24 deletions(-)
---
diff --git a/r-scripts/sprintEncoder.R b/r-scripts/sprintEncoder.R
index 0c7a796..b2aa4af 100644
--- a/r-scripts/sprintEncoder.R
+++ b/r-scripts/sprintEncoder.R
@@ -167,6 +167,7 @@ testEncoderCJ <- function(filename, testLength, mass, personHeight, tempC)
sprintDynamics = getDynamicsFromSprint(K = sprint$K, Vmax = sprint$Vmax, mass, tempC, personHeight)
print(paste("K =",sprintDynamics$K.fitted, "Vmax =", sprintDynamics$Vmax.fitted))
drawSprintFromEncoder(sprint = sprint, sprintDynamics = sprintDynamics, title = "Testing graph")
+ exportSprintDynamics(sprintDynamics)
}
prepareGraph(op$os, pngFile, op$graphWidth, op$graphHeight)
diff --git a/r-scripts/sprintPhotocells.R b/r-scripts/sprintPhotocells.R
index a5a2249..fa75914 100644
--- a/r-scripts/sprintPhotocells.R
+++ b/r-scripts/sprintPhotocells.R
@@ -188,30 +188,7 @@ drawSprintFromPhotocells <- function(sprintDynamics, splitTimes, positions, titl
paste("pmax =", round(sprintDynamics$pmax.rel.fitted, digits = 2), "W/Kg")),
text.col = c("black", "black", "green", "blue", "red"))
- exportData = list(Mass = sprintDynamics$Mass,
- Height = sprintDynamics$Height,
- Temperature = sprintDynamics$Temperature,
- Vw = sprintDynamics$Vw,
- Ka = sprintDynamics$Ka,
- K.fitted = sprintDynamics$K.fitted,
- Vmax.fitted = sprintDynamics$Vmax,
- amax.fitted = sprintDynamics$amax.fitted,
- fmax.fitted = sprintDynamics$fmax.fitted,
- fmax.rel.fitted = sprintDynamics$fmax.rel.fitted,
- sfv.fitted = sprintDynamics$sfv.fitted,
- sfv.rel.fitted = sprintDynamics$sfv.rel.fitted,
- sfv.lm = sprintDynamics$sfv.lm,
- sfv.rel.lm = sprintDynamics$sfv.rel.lm,
- pmax.fitted = sprintDynamics$pmax.fitted,
- pmax.rel.fitted = sprintDynamics$pmax.rel.fitted,
- tpmax.fitted = sprintDynamics$tpmax.fitted,
- F0 = sprintDynamics$F0,
- F0.rel = sprintDynamics$F0.rel,
- V0 = sprintDynamics$V0,
- pmax.lm = sprintDynamics$pmax.lm,
- pmax.rel.lm = sprintDynamics$pmax.rel.lm)
- write.csv2(exportData, file = paste(tempPath, "/sprintResults.csv", sep = ""))
-
+ exportSprintDynamics(sprintDynamics)
}
testPhotocellsCJ <- function(positions, splitTimes, mass, personHeight, tempC)
diff --git a/r-scripts/sprintUtil.R b/r-scripts/sprintUtil.R
index a7e1e79..a8735c8 100644
--- a/r-scripts/sprintUtil.R
+++ b/r-scripts/sprintUtil.R
@@ -95,6 +95,33 @@ getDynamicsFromSprint <- function(K, Vmax, Mass, Temperature = 25, Height , Vw =
p.fitted = p.fitted ))
}
+exportSprintDynamics <- function(sprintDynamics)
+{
+ exportData = list(Mass = sprintDynamics$Mass,
+ Height = sprintDynamics$Height,
+ Temperature = sprintDynamics$Temperature,
+ Vw = sprintDynamics$Vw,
+ Ka = sprintDynamics$Ka,
+ K.fitted = sprintDynamics$K.fitted,
+ Vmax.fitted = sprintDynamics$Vmax,
+ amax.fitted = sprintDynamics$amax.fitted,
+ fmax.fitted = sprintDynamics$fmax.fitted,
+ fmax.rel.fitted = sprintDynamics$fmax.rel.fitted,
+ sfv.fitted = sprintDynamics$sfv.fitted,
+ sfv.rel.fitted = sprintDynamics$sfv.rel.fitted,
+ sfv.lm = sprintDynamics$sfv.lm,
+ sfv.rel.lm = sprintDynamics$sfv.rel.lm,
+ pmax.fitted = sprintDynamics$pmax.fitted,
+ pmax.rel.fitted = sprintDynamics$pmax.rel.fitted,
+ tpmax.fitted = sprintDynamics$tpmax.fitted,
+ F0 = sprintDynamics$F0,
+ F0.rel = sprintDynamics$F0.rel,
+ V0 = sprintDynamics$V0,
+ pmax.lm = sprintDynamics$pmax.lm,
+ pmax.rel.lm = sprintDynamics$pmax.rel.lm)
+ write.csv2(exportData, file = paste(tempPath, "/sprintResults.csv", sep = ""))
+}
+
#Finds the time correspondig to a given position in the formula x(t) = Vmax*(t + (1/K)*exp(-K*t)) -Vmax - 1/K
#Uses the iterative Newton's method of the tangent aproximation
splitTime <- function(Vmax, K, position, tolerance = 0.001, initTime = 1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]