Consolidate States/DEFAULT_THRESHOLDS into temp_controller_base.py
tc_constants.py only held States and DEFAULT_THRESHOLDS, both used exclusively by temp_controller_base.py and its subclasses; fold them into temp_controller_base.py directly and drop the now-empty module. Also drop heat_diffusion.py, unused since pot.py switched to the delay-line model, and the matching dead import in pot.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import numpy as np
|
||||
|
||||
|
||||
class HeatDiffusion:
|
||||
def __init__(self, dt, delay, ic=0):
|
||||
self.alpha = dt/delay
|
||||
self.beta = 1 - self.alpha
|
||||
self.state = ic
|
||||
|
||||
def initial(self, ic):
|
||||
self.state = ic
|
||||
|
||||
def process(self, x):
|
||||
self.state = self.beta * self.state + self.alpha*x
|
||||
return self.state
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
d = HeatDiffusion(0.1, 1)
|
||||
|
||||
for i in range(1, 200):
|
||||
y = d.process(1)
|
||||
print("In = {}, out = {}".format(i, y))
|
||||
@@ -1,5 +1,4 @@
|
||||
from components.aplant import APlant
|
||||
from components.plant.heat_diffusion import HeatDiffusion
|
||||
from components.plant import delay
|
||||
|
||||
class Pot(APlant):
|
||||
|
||||
Reference in New Issue
Block a user