This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function plotFFT(v,fs) | |
%plotFFT | |
%Plot the Fourier spectrum of a real-valued signal | |
%John J Davis IV | |
%john@johnjdavis.io | |
% Released under MIT license: https://opensource.org/licenses/MIT | |
% Input: | |
% | |
% v - (vector) signal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(mgcv) | |
library(gratia) #For nicer gam plots | |
library(viridis) #For nicer colors | |
#if you don't have above libraries run | |
# install.packages("tidyverse") | |
# install.packages("mgcv") | |
# install.packages("gratia") | |
# install.packages("viridis") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function k_joint = calculate_joint_stiffness(ankle_angle, joint_angle, joint_moment, joint_name) | |
%Calculates joint stiffness per the Hamill et al 2014 method | |
% John J Davis IV | |
%IU Biomechanics Lab | |
% @JDruns | |
%30 June 2020 | |
% --- INPUT: --- | |
% ankle_angle - (vector) ankle angle data in degrees, respecting right hand rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2021-11-29 16:19:53.753] [info] Loaded model subject_scale_walk from file C:\Users\johnj\Google Drive\IU Grad school\OpenSim\Resources\Models\Rajagopal 2015 Model and Data\RRA\walk\subject_walk_rra2_v4_3_recfem_l.osim | |
[2021-11-29 16:20:18.823] [info] Adding force object set from C:\Users\johnj\Google Drive\IU Grad school\OpenSim\Resources\Models\Rajagopal 2015 Model and Data\CMC\walk\cmc_actuators.xml | |
[2021-11-29 16:20:18.902] [info] Running tool 'cmc'. | |
[2021-11-29 16:20:18.922] [warning] ExternalLoades: external_loads_model_kinematics_file option is not supported anymore. Results may change. | |
[2021-11-29 16:20:18.931] [info] ExternalLoads 'grf_walk' was renamed and is being reset to 'externalloads'. | |
[2021-11-29 16:20:18.986] [info] TaskSet size = 29. | |
[2021-11-29 16:20:19.112] [info] Storage: read data file = ../../ExpData/grf_walk.mot (nr=4778 nc=19) | |
[2021-11-29 16:20:19.155] [info] ExternalForce::Right_GRF Data source being set to subject11_noload_free_trial03_ground_reaction | |
[2021-11-29 16:20:19.156] [info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2021-11-29 15:39:05.587] [info] Loaded model subject_scale_walk from file C:/Users/johnj/Google Drive/IU Grad school/OpenSim/Resources/Models/Rajagopal 2015 Model and Data/RRA/walk/subject_walk_rra2_v4_3_left_vasti_dgf.osim | |
[2021-11-29 15:39:26.211] [info] Adding force object set from C:\Users\johnj\Google Drive\IU Grad school\OpenSim\Resources\Models\Rajagopal 2015 Model and Data\CMC\walk\cmc_actuators.xml | |
[2021-11-29 15:39:26.301] [info] Running tool 'cmc'. | |
[2021-11-29 15:39:26.322] [warning] ExternalLoades: external_loads_model_kinematics_file option is not supported anymore. Results may change. | |
[2021-11-29 15:39:26.331] [info] ExternalLoads 'grf_walk' was renamed and is being reset to 'externalloads'. | |
[2021-11-29 15:39:26.389] [info] TaskSet size = 29. | |
[2021-11-29 15:39:26.511] [info] Storage: read data file = ../../ExpData/grf_walk.mot (nr=4778 nc=19) | |
[2021-11-29 15:39:26.553] [info] ExternalForce::Right_GRF Data source being set to subject11_noload_free_trial03_ground_reaction | |
[2021-11-29 15:39:26.553] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(mgcv) | |
library(plot3D) | |
#Set up sample data | |
set.seed(42) | |
x <- runif(200, -1,1) | |
y <- runif(200, -1,1) | |
z <- exp(-(x^2 + y^2)) + rnorm(200, 0, 0.15) | |
#Fit 2D thin-plate regression spline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function plotFFT(v,fs) | |
%plotFFT Quick function to plot the frequency content of a signal | |
% Input: | |
% | |
% v - (vector) signal | |
% fs - sample frequency in Hz | |
% | |
% Output: | |
% none, just plots the FFT spectrum and highlights dominant frequency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------------- | |
# Add economic development data to train and test | |
#------------------------------------------------------------------- | |
covid_train <- read.csv("train.csv", stringsAsFactors = FALSE) %>% | |
mutate(Province_State = ifelse(Province_State == "", "none", Province_State)) %>% | |
unite(country_and_province, | |
Country_Region, Province_State, | |
remove=FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Kaggle COVID19 prediction model | |
#JJD | |
#24 march 2020 | |
#johnjdiv@gmail.com | |
library(tidyverse) | |
library(nlme) | |
library(HRW) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(ggplot2) | |
library(shadowtext) | |
#John J Davis IV | |
#Biomechanics PhD Student | |
#Indiana University School of Public Health | |
#Twitter: @JDRuns | |
#Email: jjd1@iu.edu | |
#25 March 2020 |