I see this as two questions really;
- How does the car charge (driver control or via mapping?), and
- How does a team determine the best place on the track to charge, or to deploy energy?
The former is fairly straightforward - there are predefined maps on the steering wheel for when to charge the car. The driver can select between these. At the extremes are "don't charge at all" (for the quali lap run) and ("charge everything to the max") which is most likely going to be used on the out lap before the quali run to the get the battery to a point where it has >4MJ of charge. (I say >4MJ because the exit from the last corner prior to the quali lap happening is not counted in the 4MJ, so actually the battery packs will have a higher capacity than 4).
There's also a separate button on the wheel for energy deployment (which is in addition to a mapped deployment which would occur regardless).
Combining the predefined maps for charging and deployment with the override for deployment puts the driver into fairly decent control of the system.
On the subject of "how do we map this in the first place" - there are lots of methods, but what's important is that there is always going to be a compromise between charging, deployment, car weight, racing line, tyre pressure, aero setup (lift/drag compromise), suspension setup, and racing position in terms of where the vehicle is faster compared to the competition on each portion of each lap. There are many other factors, but lets just look at these.
Why do I state all these things?
- Firstly - the cars are generally going to charge under braking. In this state, the car has to shed energy anyway - so it makes sense to do this here, and there are limited circumstances where one would want to not do this - related to better control of braking over bumps or heating the rear tyres, or something like that, where you only want the mechanical braking to work.
- The car will generally deploy energy once no longer traction limited out of corners. If there's an energy budget (the amount of energy collected on a lap) then there will be a decision on which corners to deploy on, and for how long.
- The car will generally deploy energy to spin up the ERS-H/compressor (this varies by manufacturer and year - Honda want to stay constant RPM, Ferrari used to do that but not in 2017, Mercedes have been and remain variable). In quali, it's likely that all the manufacturers do some level of ERS-H spinup this way.
- The car weight at the start of the race is a function of the fuel level. The cars are allowed up to 105kg, but generally every car will start below this level, for performance. The lightest cars will be kindest on their tyres and will be fastest at the start of the race (instead of weighing perhaps 35kg more than the competition and running a richer fuel mode for more power, they run lighter on fuel and consequently take less life from the tyre at the cost of less power from the leaner fuel mix).
- The racing line can be either longer or shorter, and tighter or more of a straight line. Each of these has a fuel economy consequence - the straighter line is obviously going to use less fuel because of a shorter distance, however a wider corner entry and exit may use less fuel than a tighter one due to lower tyre scrub, so there's a compromise to be made there too, and compromises on the drag/downforce and chassis settings can also affect this.
- Tyre pressures generally are as low as possible - however it's quite feasible that some cars run more than the minimum. Higher tyre pressures = lower rolling resistance, so they have an impact on fuel economy. Generally this will always come second to cornering and braking performance though.
- aero drag (=downforce) levels are going to vary and this is one of the biggest determinants of fuel economy. This is an aero and car concept philosophy thing - Mercedes run much higher downforce+drag than williams, for the same basic PU, for example. Williams are lighter, and have higher end-of-straight speeds, Mercedes are heavier (fuel load), and have more performance in corners and under braking. Mercedes have fewer problems keeping tyre temperature because of this. Williams makes for a better overtaking machine at end-of-straight because of their lower drag so they are choosing to make their car faster in certain places (straights) at the cost of cornering/braking performance.
- When in the race to use the performance. F1 races are obviously to the finish line (distance - 305km except Monaco, or 2 hour time limit, which is often only a factor in Singapore). In fact they often are a race to the track position at the last stop for each car (because overtakes on track are very difficult) - so the teams don't run the same on each lap. The first lap and each lap around the pitstops are the most important for track position so it's certainly the case that these will be run under less fuel economy pressure than the others. Equally, after the last stop, each of the cars will generally be in more of a fuel-saving mode than before that stop (because they want to get to that stop with the best track position, they will use more fuel on average before than after the last stops).
- Track elevation changes - >1MJ delta per lap at certain tracks (eg. Spa).
There are umpteen other parts to this, all of them have a knock-on consequence elsewhere.
For some people this would perhaps lead to an attitude of "well, there's no single answer to this" and a series of guesses/estimates would be made, but actually there is also a logic tool that can be applied in terms of simulation of all the factors.
It's a branch of maths called "optimal control" problems, and is essentially a statistical evaluation of multiple parameters (including all those above) needs to be more heavily weighted in order to achieve a certain goal (in this case, generally that's going to be elapsed time to get to the last pitstop while maintaining enough performance after that to not be overtaken).
There's a professor in Oxford who did this for Ferrari with the results starting in the 2014 year - You can find a link to a video of him talking about it here
https://www.mathworks.com/videos/optima ... 96763.html
All of the top teams use this sort of technique to determine not only how to map the energy systems of the car to each track of the season, but also to determine where to get the most bang for their bucks in terms of developing the car through the season and what to do next season. It's how they decide how big of a cooling capacity to design into the car, how much drag they can live with, etc. It's not guesswork, it's based on cold logic. It's also how Merc end up with a car that can't run in traffic without overheating - it's optimised around being in cold air at the front of the pack.
I suspect this is a fuller answer than OP expected.