Skip to content

Commit

Permalink
reduce winter/summer effect, adjust pv scaleFactor
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Feb 15, 2024
1 parent 60cca39 commit 7fe1749
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions india_forecast_app/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _generate_dummy_forecast(self, timestamp: dt.datetime):
return values


def _basicSolarYieldFunc(timeUnix: int, scaleFactor: int = 10000) -> float:
def _basicSolarYieldFunc(timeUnix: int, scaleFactor: int = 4000) -> float:
"""Gets a fake solar yield for the input time.
The basic yield function is built from a sine wave
Expand All @@ -82,9 +82,9 @@ def _basicSolarYieldFunc(timeUnix: int, scaleFactor: int = 10000) -> float:
# translateX moves the minimum of the function to 0 hours
translateX = -math.pi / 2
# translateY modulates the base function based on the month.
# * + 0.5 at the summer solstice
# * - 0.5 at the winter solstice
translateY = math.sin((math.pi / 6) * time.month + translateX) / 2.0
# * + 0.01 at the summer solstice
# * - 0.01 at the winter solstice
translateY = math.sin((math.pi / 6) * time.month + translateX) / 100.0

# basefunc ranges between -1 and 1 with a period of 24 hours,
# peaking at 12 hours.
Expand All @@ -94,7 +94,7 @@ def _basicSolarYieldFunc(timeUnix: int, scaleFactor: int = 10000) -> float:
# Remove negative values
basefunc = max(0, basefunc)
# Steepen the curve. The divisor is based on the max value
basefunc = basefunc**4 / 1.5**4
basefunc = basefunc**4 / 1.01**4

# Instead of completely random noise, apply based on the following process:
# * A base noise function which is the product of long and short sines
Expand Down

0 comments on commit 7fe1749

Please sign in to comment.