- use heat diffusion for water model instead of delay line
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from components.aplant import APlant
|
||||
from components.plant.delay import Delay
|
||||
from components.plant.heat_diffusion import HeatDiffusion
|
||||
|
||||
|
||||
class Pot(APlant):
|
||||
@@ -22,7 +22,7 @@ class Pot(APlant):
|
||||
self.theta_amb = theta_amb
|
||||
|
||||
self.power_set = 0
|
||||
self.delay = Delay(self.dt, self.Td, params['theta'])
|
||||
self.delay = HeatDiffusion(self.dt, self.Td, params['theta'])
|
||||
|
||||
def initial(self, temp):
|
||||
self.temp_intermediate = temp
|
||||
@@ -33,12 +33,12 @@ class Pot(APlant):
|
||||
pass
|
||||
|
||||
def process(self):
|
||||
power = self.gain * self.power_set
|
||||
leak = 1/self.M * self.L * (self.theta_amb - self.temp)/self.theta_amb
|
||||
self.temp_intermediate += (self.power_set / (self.M * self.C) + leak) * self.dt
|
||||
self.temp_intermediate += (power / (self.M * self.C) + leak) * self.dt
|
||||
|
||||
# Delay
|
||||
self.delay.put(self.temp_intermediate)
|
||||
self.temp = self.delay.get()
|
||||
self.temp = self.delay.process(self.temp_intermediate)
|
||||
|
||||
def is_activated(self):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user