On a Benetau 411(12.5m), you can probably want it around 15° below ~7 knots boatspeed (Fn0.3-0.35) in the pursuit of minimising wetted surface area and viscous drag. Going more than this - say 20°, you can start introducing resistance from the rudder and keel broaching the water surface. You also have diminishing returns as what you gain in boatspeed you loose in leeway angle as your appendages become less efficient, so i think 15° is safe and beneficial, but feel free to disagree - it wont suit all boats.
Any faster than 7 knots and wetted surface area is no longer a primary concern, so get the boat flat so your appendages work as efficiently as possible and your waterline is as symmetrical as possible - ie. the flatter the better.
In answer to your real question. Yes there is a scientific way to do this, however, not without some parameters that are pretty difficult to measure by hand. Even then, the easy equations for resistance are based on tow tank testing and calculating where you are on a spectrum of towed model data. This paper-> The Influence of Heel on the Bare Hull Resistance of a Sailing yacht. is pretty good example of that, but unless you're up to speed with terminology of design ratio's(BwL/Tc=waterline beam/bare-hull draft), you'll probably find it more greek than sailing. I haven't touched on appendages at heel and weather helm, but you can look into those as major factors in optimum heel too.