[chronojump] raceAnalyzer export instantaneous exports accel fitted
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] raceAnalyzer export instantaneous exports accel fitted
- Date: Fri, 25 Jun 2021 16:49:03 +0000 (UTC)
commit 95dd0529e5d1521a06afc8822a7b39f06efe4182
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Jun 25 18:48:09 2021 +0200
raceAnalyzer export instantaneous exports accel fitted
r-scripts/sprintEncoder.R | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/r-scripts/sprintEncoder.R b/r-scripts/sprintEncoder.R
index 1301f3dc3..2f0444d76 100644
--- a/r-scripts/sprintEncoder.R
+++ b/r-scripts/sprintEncoder.R
@@ -798,22 +798,26 @@ testEncoderCJ <- function(filename, filenameInstantaneous, testLength, splitLeng
if(filenameInstantaneous != "")
{
#print("sprintRawDynamics lengths:")
- #print(length(sprintRawDynamics$time))
+ #print(length(sprintRawDynamics$time))
#print(length(sprintRawDynamics$rawPosition))
#print(length(sprintRawDynamics$rawSpeed))
#print(length(sprintRawDynamics$rawAccel))
#print(length(sprintRawDynamics$rawForce))
#print(length(sprintRawDynamics$rawPower))
+ sfitted = sprintRawDynamics$Vmax * (1-exp(-sprintRawDynamics$K *
sprintRawDynamics$time))
+ afitted = sprintRawDynamics$Vmax * sprintRawDynamics$K * exp(-sprintRawDynamics$K *
sprintRawDynamics$time)
+
exportInstantaneous <- cbind (sprintRawDynamics$time, sprintRawDynamics$rawPosition,
c(0, sprintRawDynamics$rawSpeed), c(0, 0,
sprintRawDynamics$rawAccel), #0s are to have same length in all variables
sprintRawDynamics$rawForce, sprintRawDynamics$rawPower,
- sprintRawDynamics$Vmax * (1-exp(-sprintRawDynamics$K *
sprintRawDynamics$time)) #speed (fitted)
+ sfitted,
+ afitted
)
colnames(exportInstantaneous) = c("Time", "Position",
"Speed (raw)", "Accel (raw)", "Force (raw)", "Power (raw)",
- "Speed (fitted)", "Accel (fitted)", "Force (fitted)", "Power
(fitted)")
+ "Speed (fitted)", "Accel (fitted)")#, "Force (fitted)", "Power
(fitted)")
if(op$decimalCharAtExport == ".")
write.csv(exportInstantaneous, file = filenameInstantaneous, row.names =
FALSE, na="")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]