Profiles & Providers
Simulation behavior is driven by pluggable profile providers. Override defaults by registering custom implementations via DI.
Load Profiles
ILoadProfileProvider
csharp
public interface ILoadProfileProvider
{
double GetLoadPower(DateTime utcTime);
}Built-in Profiles
ResidentialLoadProfile
Typical home consumption:
| Time | Power | Description |
|---|---|---|
| 00:00-06:00 | 500 W | Standby appliances |
| 06:00-09:00 | 3,000 W | Morning routine |
| 09:00-17:00 | 800 W | Daytime |
| 17:00-22:00 | 4,000 W | Evening peak |
| 22:00-24:00 | 1,500 W | Late evening |
Includes ±20% random variance.
CommercialLoadProfile
Office/commercial building (configurable peak demand, default 250 kW):
| Time | % of Peak | Description |
|---|---|---|
| Weekend | 10% | Minimal |
| 00:00-07:00 | 15% | Night |
| 07:00-09:00 | 60% | Startup |
| 09:00-17:00 | 85% | Business hours |
| 17:00-19:00 | 50% | Closing |
| 19:00-24:00 | 20% | Evening |
ConstantLoadProfile
Fixed power consumption. Useful for testing.
CsvLoadProfile
Load from CSV file for measured data or custom patterns.
Solar Profiles
ISolarProfileProvider
csharp
public interface ISolarProfileProvider
{
double GetSolarOutput(DateTime utcTime, double installedCapacityW);
}Built-in: SimpleSolarProfile
Bell curve generation pattern:
- Generation hours: 6:00-20:00
- Peak at solar noon
- Cloud cover variance for realism
EV Charging Profiles
IEvChargingProfileProvider
csharp
public interface IEvChargingProfileProvider
{
bool IsVehicleConnected(DateTime utcTime);
double GetChargingPower(DateTime utcTime);
}Built-in: CommuterEvProfile
Typical commuter pattern:
| Property | Value |
|---|---|
| Charging window | 6 PM - 10 PM |
| Charge power | 7.4 kW |
| Pattern | Evening charging |
Electricity Pricing
IElectricityPricingProvider
csharp
public interface IElectricityPricingProvider
{
decimal GetPrice(DateTime utcTime);
}Built-in: TimeOfUsePricingProvider
Time-of-use rates:
| Period | Time | Rate |
|---|---|---|
| Off-peak | 00:00-07:00, 09:00-17:00 | $0.08/kWh |
| Morning shoulder | 07:00-09:00 | $0.15/kWh |
| Peak | 17:00-21:00 | $0.30/kWh |
| Evening shoulder | 21:00-24:00 | $0.12/kWh |
Demand Response
IDemandResponseProvider
csharp
public interface IDemandResponseProvider
{
bool IsEventActive(DateTime utcTime);
double GetRequestedReduction(DateTime utcTime);
}Built-in: SimpleDemandResponseProvider
Simulates DR events on hot summer afternoons:
| Property | Value |
|---|---|
| Active months | June-August |
| Peak hours | 3 PM - 7 PM |
| Event probability | 10% on eligible days |
| Requested reduction | 5,000 W |
Grid Status
IGridStatusProvider
csharp
public interface IGridStatusProvider
{
bool IsGridAvailable(DateTime utcTime);
}Built-in: GridOutageStatusProvider
Simulates grid outages for testing islanding and backup scenarios.
Custom Registration
Register custom providers via DI to override defaults:
csharp
// Custom load profile
services.AddSingleton<ILoadProfileProvider, MyFactoryLoadProfile>();
// Custom solar profile
services.AddSingleton<ISolarProfileProvider, WeatherApiSolarProfile>();
// Custom pricing
services.AddSingleton<IElectricityPricingProvider, DynamicSpotPricing>();
// Custom DR events
services.AddSingleton<IDemandResponseProvider, GridOperatorDRProvider>();