Skip to content

Commit

Permalink
Merge pull request #10 from faweigend/new_threecomphyd_incorp
Browse files Browse the repository at this point in the history
New threecomphyd incorp
  • Loading branch information
faweigend authored Oct 31, 2021
2 parents 8038a4a + b11d01a commit 4b9abd2
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 43 deletions.
18 changes: 10 additions & 8 deletions example_scripts/compare_bartram_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ def compare_bartram_dataset(plot: bool = False, hz: int = 1) -> dict:

# three component hydraulic agent configuration fitted to
# W' and CP group averages reported by Bartram et al.
p = [28295.84803812729,
115866.92894681037,
393.69013448575697,
125.81789182612417,
10.42071828931923,
0.8323218320947604,
0.034587477091268214,
0.13458173082205677]
p = [
23111.907625379536,
65845.27856132743,
391.57216549178816,
148.88277278309968,
24.148071239095923,
0.7300850921939723,
0.010572800716668246,
0.24210496214582158
]

# setup all used agents
bart = WbalODEAgentBartram(w_p=w_p, cp=cp, hz=hz)
Expand Down
18 changes: 10 additions & 8 deletions example_scripts/compare_caen_2021_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ def compare_caen_2021_dataset(plot: bool = False, hz: int = 1) -> dict:

# fitted to Caen et al. 2021 (w_p = 19200 cp = 269) with recoveries from Caen et al. (2019)
# general settings for three component hydraulic agent
p = [20677.1733445497,
179472.5078726373,
269.3909629386831,
87.53155946812194,
8.867173757279756,
0.8086915379675802,
0.12369693383481795,
0.17661428891272302]
p = [
17631.060154686846,
46246.12685807986,
267.2841865716247,
117.58879540373458,
20.086989783398884,
0.6761473340497611,
0.010446724632575614,
0.28907732540761866
]

agent_skiba_2015 = WbalODEAgentSkiba(w_p=w_p, cp=cp, hz=hz)
agent_bartram = WbalODEAgentBartram(w_p=w_p, cp=cp, hz=hz)
Expand Down
18 changes: 10 additions & 8 deletions example_scripts/compare_chidnok_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ def compare_chidnok_dataset(plot: bool = False, hz: int = 1) -> dict:

# fitted to Chidnok et al. (w_p=21100, cp=241) with recovery from Caen et al.
# general settings for three component hydraulic agent
p = [20047.50153689523,
115140.99890071881,
240.68973456248304,
95.20145903978242,
10.205583305433073,
0.7283879087791809,
0.15441713985950212,
0.24669788914354474]
p = [
18919.762073227383,
48051.773725079634,
239.55392427569362,
115.0462376883594,
19.47734052698647,
0.6470383748194338,
0.048256367960376,
0.30867198281089636
]

# setup all used agents
bart = WbalODEAgentBartram(w_p=w_p, cp=cp, hz=hz)
Expand Down
18 changes: 10 additions & 8 deletions example_scripts/compare_ferguson_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ def compare_ferguson_dataset(plot: bool = False, hz: int = 1) -> dict:

# fitted to Ferguson et al. (w_p = 21600 cp = 212) with recoveries from Caen et al.
# general settings for three component hydraulic agent
p = [19858.664401062637,
381285.47724572546,
211.56829509658024,
84.1393682475386,
9.876294372943931,
0.7148516516658686,
0.25013512969210605,
0.2794394105229545]
p = [
18730.04887669842,
81030.54914024667,
211.5583717747421,
94.30913367766424,
18.75659352000352,
0.6343242626696716,
0.204894046277973,
0.3363619580983015
]

# ground truth measures from the paper
ground_truth_t = [120, 360, 900]
Expand Down
16 changes: 8 additions & 8 deletions example_scripts/compare_weigend_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ def compare_weigend_dataset(plot: bool = False, hz: int = 1) -> dict:

# hydraulic parameters fitted to W' and CP by Caen et al. 2019
p = [
15526.629149872091,
68352.75597080137,
248.19813883137562,
96.80164094813664,
10.247146084511353,
0.7397944818727281,
0.07576781919703725,
0.23674229355251739
18042.056916563655,
46718.177938027344,
247.39628102450715,
106.77042879166977,
16.96027055119397,
0.715113715965181,
0.01777338005017555,
0.24959503053279475
]

agent_skiba_2015 = WbalODEAgentSkiba(w_p=w_p, cp=cp, hz=hz)
Expand Down
3 changes: 2 additions & 1 deletion example_scripts/simulate_artificial_course.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

import matplotlib.pyplot as plt
from pypermod.agents.wbal_agents.wbal_int_agent_skiba import WbalIntAgentSkiba
from pypermod.agents.wbal_agents.wbal_ode_agent_bartram import WbalODEAgentBartram
from pypermod.simulator.simulator_basis import SimulatorBasis
from pypermod.agents.wbal_agents.wbal_ode_agent_skiba import WbalODEAgentSkiba
Expand Down Expand Up @@ -57,7 +58,6 @@

# format axis
ax.set_ylim([0, cp * 2.5])
ax.axhline(y=cp, linestyle="--", color='red', label="critical power (CP)")

# label plot
ax.set_ylabel("power output (watts)")
Expand All @@ -67,6 +67,7 @@
ax.set_yticks([agent_ode.cp])
ax.set_yticklabels(["CP"])
ax.tick_params(axis='y', colors='red')
ax.axhline(y=cp, linestyle="--", color='red', label="critical power (CP)")

ax2.set_yticks([0, agent_ode.w_p])
ax2.set_yticklabels([0, r'$W^\prime$'])
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pypermod
version = 1.0.1
version = 1.0.2
author = Fabian Weigend
author_email = fabian.weigend@westernsydney.edu.au
description = A performance modeling package that provides various tools to predict energy expenditure and recovery dynamics of an athlete
Expand All @@ -24,7 +24,7 @@ install_requires =
scipy
scikit-learn
numpy
threecomphyd==1.0.1
threecomphyd

[options.packages.find]
where = src

0 comments on commit 4b9abd2

Please sign in to comment.