Example #1
0
 /**
  * Recalculate maximal values for CTL/ATL/Trimp
  */
 public function recalculateMaxValues()
 {
     $Query = new Performance\ModelQuery();
     $Query->execute(\DB::getInstance());
     $Calc = new Performance\MaximumCalculator(function (array $array) {
         return new Performance\TSB($array, Configuration::Trimp()->daysForCTL(), Configuration::Trimp()->daysForATL());
     }, $Query->data());
     $this->updateMaxCTL($Calc->maxFitness());
     $this->updateMaxATL($Calc->maxFatigue());
     $this->updateMaxTrimp($Calc->maxTrimp());
 }
 /**
  * All categories
  * @return ConfigurationCategory[]
  */
 private function allCategories()
 {
     return array(Configuration::General(), Configuration::Privacy(), Configuration::ActivityView(), Configuration::ActivityForm(), Configuration::Design(), Configuration::DataBrowser(), Configuration::Vdot(), Configuration::Trimp(), Configuration::BasicEndurance(), Configuration::Misc());
 }
    /**
     * Get fieldset for TRIMP
     * @return \FormularFieldset
     */
    public function getFieldsetTRIMP()
    {
        $ModelQuery = new Performance\ModelQuery();
        $ModelQuery->execute(DB::getInstance());
        $TSBmodel = new Performance\TSB($ModelQuery->data(), Configuration::Trimp()->daysForCTL(), Configuration::Trimp()->daysForATL());
        $TSBmodel->calculate();
        $maxATL = Configuration::Data()->maxATL();
        $maxCTL = Configuration::Data()->maxCTL();
        $ATL = $TSBmodel->fatigueAt(0);
        $CTL = $TSBmodel->fitnessAt(0);
        $TrimpValues = array('ATL' => round(100 * $ATL / $maxATL), 'CTL' => round(100 * $CTL / $maxCTL), 'TSB' => $TSBmodel->performanceAt(0));
        $Table = '
			<table class="fullwidth zebra-style">
				<thead>
					<tr>
						<th></th>
						<th>' . __('Name') . '</th>
						<th>' . __('in &#37;') . '</th>
						<th>' . __('Time range') . '</th>
						<th>' . __('&oslash; value/day') . '</th>
						<th>' . __('max. value') . '</th>
						<th class="small">' . __('Description') . '</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="b">ATL</td>
						<td>' . __('Actual Training Load') . '</td>
						<td class="c">' . $TrimpValues['ATL'] . ' &#37;</td>
						<td class="c small">' . sprintf(__('%s days'), Configuration::Trimp()->daysForATL()) . '</td>
						<td class="c">' . $ATL . '</td>
						<td class="c">' . $maxATL . '</td>
						<td class="small">' . __('Training impulse over a short period') . '</td>
					</tr>
					<tr>
						<td class="b">CTL</td>
						<td>' . __('Chronical Training Load') . '</td>
						<td class="c">' . $TrimpValues['CTL'] . ' &#37;</td>
						<td class="c small">' . sprintf(__('%s days'), Configuration::Trimp()->daysForCTL()) . '</td>
						<td class="c">' . $CTL . '</td>
						<td class="c">' . $maxCTL . '</td>
						<td class="small">' . __('Training impulse over a long period') . '</td>
					</tr>
					<tr>
						<td class="b">TSB</td>
						<td>' . __('Training Stress Balance') . '</td>
						<td class="c">' . $TrimpValues['TSB'] . '</td>
						<td colspan="3" class="c">' . $CTL . ' - ' . $ATL . ' = ' . $TrimpValues['TSB'] . '</td>
						<td class="small">' . __('Current impulse<br>positive: recovery<br>negative: hard training') . '
						</td>
					</tr>
				</tbody>
			</table>';
        $Fieldset = new FormularFieldset('ATL/CTL/TSB');
        $Fieldset->addBlock(__('ATL/CTL are based on the TRIMP-concept, which adresses an impulse value to every activity. ' . 'ATL and CTL are averaged values over a given time range.'));
        $Fieldset->addBlock($Table);
        $Fieldset->addInfo(__('see <a href="http://www.netzathleten.de/fitness/richtig-trainieren/item/1481-trainingstagebuch-sinnvoll-oder-nicht" title="Das TRIMP-Konzept">The TRIMP-concept</a> (german, netzathleten.de)'));
        $Fieldset->addInfo(__('see <a href="http://fellrnr.com/wiki/TRIMP">TRIMP</a> and <a href="http://fellrnr.com/wiki/Modeling_Human_Performance#The_TSB_Formulas">Modeling Human Performance</a> on fellrnr.com'));
        return $Fieldset;
    }
Example #4
0
$Plot->Data[] = array('label' => __('Fitness (CTL)'), 'color' => '#008800', 'data' => $CTLs);
//if (count($ATLs) < $MaxATLPoints)
$Plot->Data[] = array('label' => __('Fatigue (ATL)'), 'color' => '#CC2222', 'data' => $ATLs);
$Plot->Data[] = array('label' => __('avg VDOT'), 'color' => '#000000', 'data' => $VDOTs, 'yaxis' => 2);
$Plot->Data[] = array('label' => 'TRIMP', 'color' => '#5555FF', 'data' => $TRIMPs, 'yaxis' => 3);
$Plot->Data[] = array('label' => __('day VDOT'), 'color' => '#444444', 'data' => $VDOTsday, 'yaxis' => 2);
$Plot->setMarginForGrid(5);
$Plot->setLinesFilled(array(0));
$Plot->setLinesFilled(array(1), 0.3);
$Plot->setXAxisAsTime();
if (!$All && !$lastHalf && !$lastYear) {
    $Plot->setXAxisLimitedTo($Year);
}
$Plot->addYAxis(1, 'left');
$Plot->setYTicks(1, 1);
if (Configuration::Trimp()->showInPercent()) {
    $Plot->addYUnit(1, '%');
    $Plot->setYLimits(1, 0, 100);
}
$Plot->addYAxis(2, 'right');
$Plot->setYTicks(2, 1, 1);
$Plot->addYAxis(3, 'right');
$Plot->setYLimits(3, 0, $maxTrimp * 2);
$Plot->showAsBars(3, 1, 2);
$Plot->showAsPoints(4);
$Plot->smoothing(false);
if (($lastHalf || $lastYear) && !$DataFailed) {
    $Plot->addMarkingArea('x', Plot::dayOfYearToJStime($StartYear, $HighestIndex - 30 - $AddDays + $StartDayInYear + 1), $index, 'rgba(255,255,255,0.3)');
    //'rgba(200,200,200,0.5)');
}
$Plot->setGridAboveData();
Example #5
0
 }
 $performanceModel->calculate();
 if ($All) {
     $maxATL = $performanceModel->maxFatigue();
     $maxCTL = $performanceModel->maxFitness();
     if ($perfmodel == 'tsb' && $maxATL != Configuration::Data()->maxATL()) {
         Configuration::Data()->updateMaxATL($maxATL);
     }
     if ($perfmodel == 'tsb' && $maxCTL != Configuration::Data()->maxCTL()) {
         Configuration::Data()->updateMaxCTL($maxCTL);
     }
 } else {
     $maxATL = Configuration::Data()->maxATL();
     $maxCTL = Configuration::Data()->maxCTL();
 }
 $showInPercent = Configuration::Trimp()->showInPercent() && $perfmodel != 'banister';
 if (!$showInPercent) {
     $maxATL = 100;
     $maxCTL = 100;
 }
 for ($d = $LowestIndex; $d <= $HighestIndex; $d++) {
     $index = Plot::dayOfYearToJStime($StartYear, $d - $AddDays + $StartDayInYear);
     $ATLs[$index] = 100 * $performanceModel->fatigueAt($d) / $maxATL;
     $CTLs[$index] = 100 * $performanceModel->fitnessAt($d) / $maxCTL;
     $TSBs[$index] = 100 * $performanceModel->performanceAt($d) / $maxCTL;
     $TRIMPs[$index] = $Trimps_raw[$d];
     if ($maxTrimp < $Trimps_raw[$d]) {
         $maxTrimp = $Trimps_raw[$d];
     }
     $VDOT_slice = array_slice($VDOTs_raw, $d - $VDOTdays, $VDOTdays);
     $Durations_slice = array_slice($Durations_raw, $d - $VDOTdays, $VDOTdays);