Closed taldcroft closed 3 years ago
@jzuhone - the instability was just related to this new Delay
component if the code was
comp.node.mvals[:] = np.interp(x=self.times - comp.delay * 1000,
xp=self.times, fp=comp.node.mvals)
instead of:
comp.node.mvals[1:] = np.interp(x=self.times - comp.delay * 1000,
xp=self.times, fp=comp.node.mvals)[1:]
This is what I showed at the TWG when I moved the delay
slider left and right and the beginning of the model calculation got wacky. This does not happen for the current code using [1:]
to avoid copying the first element of the array.
Description
Add a new model component class
Delay
to delay the compute model values fromnode
bydelay
ksec.For a positive delay, the computed model value (
node.mval
) will be constant at the initial value for the firstdelay
ksec. Conversely for a negative delay the values at the end will be constant fordelay
ksec.Testing
Functional testing
Made a new thermal model for 4HFSPAT using the
Delay
component (now included in theexamples/delay
directory).delay
parameter can be successfully fit withxija_gui_fit
and that the result is reasonable (i.e. the model and data peaks visually line up).