diff --git a/src/Charts/CPPlot.cpp b/src/Charts/CPPlot.cpp index 7a9ad7e69..43556b288 100644 --- a/src/Charts/CPPlot.cpp +++ b/src/Charts/CPPlot.cpp @@ -703,7 +703,7 @@ CPPlot::plotModel() // Pmax is often higher than the test values (they're for // 3-20 mins typically so well short of pmax). if (!showDelta && rideSeries == RideFile::watts && pdModel && pdModel->PMax() > ymax) { - if (pdModel->PMax() > ymax) setAxisScale(yLeft, 0, pdModel->PMax()); + if (pdModel->PMax() > ymax) setAxisScale(yLeft, 0, pdModel->PMax() * 1.1f); } } diff --git a/src/Metrics/PDModel.cpp b/src/Metrics/PDModel.cpp index a66ebf2f8..bac2dbe47 100644 --- a/src/Metrics/PDModel.cpp +++ b/src/Metrics/PDModel.cpp @@ -176,11 +176,26 @@ PDModel::deriveCPParameters(int model) // get vector of residuals QVector residuals(t.size()); double errtot=0; + double sse=0; + double meany=0; for(int i=0; inparms() > 0) { // only try lmfit if the model supports that