I am writing an application that will maintain heart rate within a specified range by adjusting the amount of work required on a turbo trainer.
I could cobble together something that would gradually increase resistance until heart rate reached the right level but I imagine reaching the desired heart rate quickly, not overshooting and maintaining it might not be a trivial exercise.
I imagine that this problem has been solved many times before and I was hoping for a relatively simple algorithm that I can implement without spending a long time fine tuning and improving it.