Open billtubbs opened 5 years ago
If this is true, I'm willing to help fix it.
Extending the model would be very useful, I think. In addition to the things you mention (changing ambient temperature and setting the temperatures), I can also think of changing the heat transfer coefficients to simulate blowing on the fins as a disturbance. Not having an easy disturbance is a major shortcoming of the model as it stands.
@jckantor How do you feel about extensions to the model?
I agree there are a few improvements possible.
Quick fix to my immediate problem:
Ta
an argument of __init__
so user can specify ambient temperature. This would mean the template of TCLabModel
is no longer identical to the real lab but at least it's fully substitutable.Other easy enhancements:
Ta
and possibly other parameters/constants into class properties so they can be varied during an experiment to simulate disturbances.I would do these first.
I also thought this might be useful sometimes:
reset()
method which resets the model instance to it's startup conditions (i.e. T1 = T2 = Ta
) - (although this makes the simulation model less realistic!)This 3rd one might take some more thinking about...
Let me know, I could have a go at these tomorrow and submit a pull request if you like.
Exposing the parameters makes sense to me. Could you elaborate on why you would want a reset()
method rather than simply creating a new object?
True, you can always instantiate a new object. If I can set the ambient temperature every time I create a new one that would be fine. The scenario where a reset becomes more convenient is if you have adjusted a few parameters to certain non-default settings and want to repeat the experiment from the initial condition (T1 = T2 = Ta
).
It's not a big deal though.
I don't think there's an obvious way to set the ambient temperature for the
TCLabModel
(simulated version) so that the heater temperatures start at a temperature other than the default value (Ta = 21
).As far as I can tell,
T1
andT2
are initialized in the__init__
method but there is no way to setTa
before this happens and no good way to change T1 and T2 after that (other thanlab._T1 = ...
).Or am I missing something?