You mean the braking curve should be steeper?
In the first attempt I just assumed a deceleration of 1 m / s ^ 2, because I thought: No one will pedal until directly before the intersection, and then brake hard. You would rather start coasting something like 250 m before, and only brake in the last 30 m or so.
A braking curve with two slopes would make things quite complicated, since braking curves can intersect arbitrarily. So I would like to stick with one single deceleration. What would be realistic (= cause the least amount of manual correction)?
Or maybe set the muscle power to 0 well in advance of the intersection. But this will fail when going uphill (one will come to a halt before the intersection and never reach it).
The problem is that the max speed curve is calculated at the very beginning, before the power calculations are done. So it must be independent of them.
Another possibility would be to somehow adjust the muscle power curve afterwards. Eg setting it to 0 before points where braking starts from more than eg 30 km / h.