Skip to content

Commit

Permalink
Use Black code style in examples as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-lundberg committed Mar 5, 2020
1 parent d1c1b64 commit b7751d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/water_boiler/water_boiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ class WaterBoiler:
Simple simulation of a water boiler which can heat up water
and where the heat dissipates slowly over time
"""

def __init__(self):
self.water_temp = 20

def update(self, boiler_power, dt):
if boiler_power > 0:
# boiler can only produce heat, not cold
self.water_temp += 1*boiler_power*dt
self.water_temp += 1 * boiler_power * dt

# some heat dissipation
self.water_temp -= 0.02*dt
self.water_temp -= 0.02 * dt
return self.water_temp


Expand All @@ -43,7 +44,7 @@ def update(self, boiler_power, dt):
power = pid(water_temp)
water_temp = boiler.update(power, dt)

x += [current_time-start_time]
x += [current_time - start_time]
y += [water_temp]
setpoint += [pid.setpoint]

Expand Down

0 comments on commit b7751d5

Please sign in to comment.