pv_opt icon indicating copy to clipboard operation
pv_opt copied to clipboard

Discharge Windows having low power values

Open stevebuk1 opened this issue 1 year ago • 1 comments

Beta testing on the Dev branch for the IOG tariff has identified very low slot values being modelled for Force Discharge.

Investigation suggests that the issue is this area of code; this should be returning the max available discharge power within a slot but is currently returning the max solar power within a slot.

                        slot = (
                            start_window,
                            -min(
                                min(self.battery.max_discharge_power, self.inverter.inverter_power),
                                -x[kwargs.get("solar", "solar")].loc[start_window],
                                ((x["soc_end"].loc[start_window] - self.battery.max_dod) / 100 * self.battery.capacity)
                                * 2
                                * factor,
                            ),
                        )

The comma was added at 3.15.4 when adding battery max discharge power. In 3.15.3 it reads:

                        slot = (
                            start_window,
                            -min(
                                self.inverter.inverter_power - x[kwargs.get("solar", "solar")].loc[start_window],
                                ((x["soc_end"].loc[start_window] - self.battery.max_dod) / 100 * self.battery.capacity)
                                * 2
                                * factor,
                            ),
                        )

i.e with no comma between the inverter power and the solar.

Whilst removing the comma would solve the main problem, I'm still not sure its right, as I think the max discharge will be the minimum of:

  1. battery power
  2. Inverter power
  3. charger power + any solar
  4. available energy left in the battery (converted to power)

??

stevebuk1 avatar Aug 05 '24 19:08 stevebuk1

This whole section of code needs tidying up as I confuse myself every time I revisit it! Will have a look.

fboundy avatar Aug 15 '24 14:08 fboundy

Stale issue message

github-actions[bot] avatar Oct 15 '24 02:10 github-actions[bot]