Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add consumption #2

Open
peterdudfield opened this issue Sep 12, 2023 · 8 comments
Open

Add consumption #2

peterdudfield opened this issue Sep 12, 2023 · 8 comments

Comments

@peterdudfield
Copy link
Contributor

Detailed Description

It would be nice to add generation into this package. This means you can add a consumption of a building, and then see how the battery should operate.

Possible Implementation

@peterdudfield
Copy link
Contributor Author

We might be able to sove this by combing consumption and solar generation to be
generation = solar generation - consumption. Then we just use generation like we have before. This might work?

@gilbertgong
Copy link
Contributor

I'm testing a version in which net_generation = solar_generation - consumption which should definitely work in principle. It does become a bit more complicated, the current constraints are set up with the expectation that solar_generation is >= 0, which of course is true with actual generation, but if we allow net_generation to be negative (due to consuming more than we're generating), then a bunch of the constraints need to be adjusted. working through that now but it's going to take some thinking..

@gilbertgong
Copy link
Contributor

Ok I'm reconsidering if net_generation = solar_generation - consumption is the way to go. Because we have to take into account a lot of different cases, like using power from the grid for consumption, using battery for consumption, charging the battery while using the grid for consumption, etc. So regardless there's going to be a bunch of constraint changes, in which case probably incorporating consumption directly will be easier to understand.

@gilbertgong
Copy link
Contributor

I'm pretty deep into this now, but I'm starting to have some questions..

Take this:

        profit = self.prices * (
            self.power_discharge_cp_variable.value - self.battery_power_charge_cp_variable.value
        )

Is "profit" supposed to mean only the money generated from selling from the battery? Shouldn't profit include revenue from solar being sold directly to the grid as well? Or do we want a separate "battery profit" and "solar profit"?

@peterdudfield
Copy link
Contributor Author

Thats great you are getting in to this.

if its possible to split it then, then do both yea. Is it possible to split them up easily? As in if some of the energy goes straight into the battery from the solar, where does that count?

@gilbertgong
Copy link
Contributor

Well, right now the profit var is actually just the battery profit, as it's counted as self.power_discharge_cp_variable.value - self.battery_power_charge_cp_variable.value (power_discharge_cp_variable represents

         # the amount of power going out of the battery
        self.power_discharge_cp_variable = cp.Variable(HOURS_PER_DAY)

solar profit would be self.prices * solar_to_grid, solar that goes to the battery would be part of battery profit. solar profit is simply ignored in the code right now, so actually the current profit numbers are basically incorrect if it was supposed to represent both solar and battery profit.

But yeah, i can fix this..

@gilbertgong
Copy link
Contributor

Also I want to check my understanding. I just noticed this:

            power_charge = (
                self.eta_charge * self.battery_power_charge_cp_variable[i]
            ) + self.power_solar_to_battery[i]

is the efficiency factor applied only to the grid charging because we assume DC to DC charging on solar to battery, which is assumed to be more efficient?

If yes I'll add some comments to clarify the reasoning..

@peterdudfield
Copy link
Contributor Author

yea, I think so, yea clarifying comments would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants