Specifically the problem is: a car accelerates gradually from a stop to reach 40km/hr after 18 meters of travel, then decelerates back to a stop in the next 3.49 meters. What is the average speed the car has traveled over the full 21.49m.
Your result should allow me to calculate alternate solutions based on different values ie: reach -x- km/hr after -y- meters of travel and decelerate to a stop in the next -z- meters. I may need some guidance on what is a 'gradual acceleration' for a car entering an intersection. Preferably the solution would include a "current rate of speed" vs time, and a resulting average speed/total time taken (area under curve). I have given a very rough graph of what I think this may look like.