24) $solar_hours = 24; if ($run_hours < 0) $run_hours = 0; if ($run_hours > 24) $run_hours = 24; $active_hours_per_year = $run_hours * 365.0; $annual_kwh = $power_w * $active_hours_per_year / 1000.0; // Netzbezug: nur die Stunden, in denen das System läuft UND keine Solarversorgung besteht. // Pro Tag: Netzstunden = max(0, run_hours - solar_hours) $net_hours_per_day = max(0.0, $run_hours - $solar_hours); $net_hours_per_year = $net_hours_per_day * 365.0; $net_kwh = $power_w * $net_hours_per_year / 1000.0; $daily_cost = ($power_w * $net_hours_per_day / 1000.0) * $price; $annual_cost = $net_kwh * $price; ?>