createDefaultLoad method

ElectricalNode createDefaultLoad({
  1. required String id,
  2. String name = 'Carga',
  3. LoadType type = LoadType.power,
})

Creates a default load

Default: 1000W power load, cosPhi varies by type

Implementation

ElectricalNode createDefaultLoad({
  required String id,
  String name = 'Carga',
  LoadType type = LoadType.power,
}) {
  // cosPhi defaults by load type (REBT typical values)
  final double defaultCosPhi;
  switch (type) {
    case LoadType.lighting:
      defaultCosPhi = 1.0; // Resistive loads
      break;
    case LoadType.power:
      defaultCosPhi = 0.9; // Typical power outlets
      break;
    case LoadType.motor:
      defaultCosPhi = 0.8; // Inductive loads
      break;
  }

  return ElectricalNode.load(
    id: id,
    name: name,
    type: type,
    powerWatts: 1000.0, // 1kW default
    cosPhi: defaultCosPhi,
    isThreePhase: false,
  );
}