fluxoid-org / CyclismoProject

Contains all subprojects and libraries for the Cyclismo project
Other
7 stars 4 forks source link

Fix issue with power model #4

Closed dougszumski closed 9 years ago

dougszumski commented 11 years ago

Kinetic energy jumps up too fast for the first time step if the updating interval is of the order of seconds or larger.

jovial commented 11 years ago

Assumption is that change in velocity is small between successive calls to org.cowboycoders.turbotrainers.PowerModel#updatepower(double) i.e use a suitably small time delta. We are polling this with org.cowboycoders.utils.FixedPeriodUpdater at a time interval of 100ms as defined in this nugget:

private FixedPeriodUpdater powerModelUpdater = new FixedPeriodUpdater(new Double(0),powerModelUpdateCallback,POWER_MODEL_UPDATE_PERIOD_MS);

from org.cowboycoders.turbotrainers.bushido.brake.BushidoBrakeSlopeController.

Add comment to explain this.