Model your installation to measure: multiple fields with their own orientation, inverter with clipping and string check, battery with self-consumption simulation, and the grid earthing system (IT, TT, TN-C, TN-S, TN-C-S).
Add one field per roof face or orientation. All fields are summed. The string check uses the module of Field 1.
The simulation dispatches energy hour by hour: first to load, surplus charges the battery and the rest is exported; at night the battery covers the load before importing from the grid.
Indicative engineering info; final protection must be defined by a licensed installer per local code (e.g. NEK 400 in Norway, IEC 60364).
Self-sufficiency and self-consumption use an hourly model of a representative day per month; these are estimates (excluding day-to-day variability or point shading). For a real project, validate with measured data and a shading study.