Class HeatingCurve
-
- All Implemented Interfaces:
Serializable,Descriptive
public class HeatingCurve extends AbstractData
TheHeatingCurverepresents a time-temperature profile (aAbstractDatainstance) generated using a calculation algorithm implemented by aProblem'sSolver. In addition to the time and signal lists defined in the super-class, it features baseline-corrected signal values stored in a separate list.TheHeatingCurvemay haveHeatingCurveListeners to process simple events. To enable comparison withExperimentalData, aHeatingCurvebuilds a spline interpolation of its time - baseline-adjusted signal values, thus representing a continuous curve, rather than just a collection of discrete data.- See Also:
HeatingCurveListener,org.apache.commons.math3.analysis.interpolation.UnivariateInterpolation, Serialized Form
-
-
Field Summary
-
Fields inherited from class pulse.AbstractData
signal, time
-
-
Constructor Summary
Constructors Modifier Constructor Description HeatingCurve()Calls the super-constructor and initialises the baseline-corrected signal list.protectedHeatingCurve(List<Double> time, List<Double> signal, double startTime, String name)HeatingCurve(HeatingCurve c)Copy constructor.HeatingCurve(NumericProperty count)Creates aHeatingCurve, where the number of elements in thetime,signal, andadjustedSignalcollections are set tocount.getValue().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeatingCurveListener(HeatingCurveListener l)voidapply(Baseline baseline)Adds the baseline value to each element of thesignallist.voidclear()Clears all elements from the threeListobjects, thus releasing memory.voidcopyToLastCalculation()booleanequals(Object o)HeatingCurveextendedTo(ExperimentalData data, Baseline baseline)This creates a newHeatingCurveto match the time boundaries of thedata.List<Double>getBaselineCorrectedData()org.apache.commons.math3.analysis.UnivariateFunctiongetInterpolation()NumericPropertygetTimeShift()The time shift is the position of the 'zero-time'.voidinitListeners()doubleinterpolateSignalAt(double x)Set<NumericPropertyKeyword>listedKeywords()ListsNUM_POINTSas an accessible property of thisPropertyHolder.doublemaxAdjustedSignal()Retrieves the simple maximum (in arbitrary units) of the baseline-corrected temperature list.voidremove(int i)Removes an element with the indexifrom all threeLists (time, signal, and baseline-corrected signal).voidremoveListeners()voidscale(double scale)Scales the temperature values by a factor ofscale.voidset(NumericPropertyKeyword type, NumericProperty property)Callssuper.setand provides write access to theTIME_SHIFTproperty.voidsetTimeShift(NumericProperty startTime)Sets the time shift and triggersTIME_ORIGIN_CHANGEDinCurveEvent.doublesignalAt(int index)Retrieves the baseline-corrected temperature corresponding toindexin the respectiveList.doubletimeAt(int index)Retrieves the time from the stored list of values, adding the value ofstartTimeto the result.-
Methods inherited from class pulse.AbstractData
actualNumPoints, addPoint, apparentMaximum, getName, getNumPoints, getSignalData, getTimeSequence, ignoreSiblings, incrementCount, isFull, setName, setNumPoints, setSignalAt, setTimeAt, timeLimit, toString
-
Methods inherited from class pulse.util.PropertyHolder
addListener, areDetailsHidden, data, describe, firePropertyChanged, getDescriptor, getListeners, getPrefix, isListedNumericType, isListedParameter, listedTypes, numericData, parameterListChanged, setPrefix, updateProperties, updateProperty
-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperties, genericProperty, numericProperties, numericProperty, property, update, update
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, getHierarchyListeners, getParent, identify, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Constructor Detail
-
HeatingCurve
protected HeatingCurve(List<Double> time, List<Double> signal, double startTime, String name)
-
HeatingCurve
public HeatingCurve()
Calls the super-constructor and initialises the baseline-corrected signal list. Creates aSplineInterpolatorobject.
-
HeatingCurve
public HeatingCurve(HeatingCurve c)
Copy constructor. In addition to copying the data, also re-builds the splines.- Parameters:
c- another instance of this class- See Also:
refreshInterpolation()
-
HeatingCurve
public HeatingCurve(NumericProperty count)
Creates aHeatingCurve, where the number of elements in thetime,signal, andadjustedSignalcollections are set tocount.getValue(). The time shift is initialized with a default value.- Parameters:
count- TheNumericPropertythat is derived from theNumericPropertyKeyword.NUMPOINTS.
-
-
Method Detail
-
initListeners
public void initListeners()
- Overrides:
initListenersin classPropertyHolder
-
copyToLastCalculation
public void copyToLastCalculation()
-
clear
public void clear()
Description copied from class:AbstractDataClears all elements from the threeListobjects, thus releasing memory.- Overrides:
clearin classAbstractData
-
timeAt
public double timeAt(int index)
Retrieves the time from the stored list of values, adding the value ofstartTimeto the result.- Overrides:
timeAtin classAbstractData- Parameters:
index- the index of the element to be returned- Returns:
- time at
index+ startTime
-
signalAt
public double signalAt(int index)
Retrieves the baseline-corrected temperature corresponding toindexin the respectiveList.- Overrides:
signalAtin classAbstractData- Parameters:
index- the index of the element- Returns:
- a double, representing the baseline-corrected temperature at
index
-
scale
public void scale(double scale)
Scales the temperature values by a factor ofscale.This is done by manually setting each temperature value to
This method is used in the DifferenceScheme subclasses when a dimensionless solution needs to be re-scaled to the given maximum temperature (usually matching theT*scale, where T is the current temperature value at this index. Finally. applies the baseline to the scaled temperature values.ExperimentalData, but also used as a search variable by theSearchTask.Triggers a
RESCALEDCurveEvent.- Parameters:
scale- the scale- See Also:
DifferenceScheme,Problem,SearchTask,CurveEvent
-
maxAdjustedSignal
public double maxAdjustedSignal()
Retrieves the simple maximum (in arbitrary units) of the baseline-corrected temperature list.- Returns:
- the simple maximum of the baseline-adjusted temperature.
-
apply
public void apply(Baseline baseline)
Adds the baseline value to each element of thesignallist.The
baseline.valueAtmethod is explicitly invoked for alltimevalues, and the result of adding the baseline value to the correspondingsignalis assigned to a position in theadjustedSignallist.- Parameters:
baseline- the baseline. Note it may not specifically belong to this heating curve.
-
extendedTo
public final HeatingCurve extendedTo(ExperimentalData data, Baseline baseline)
This creates a newHeatingCurveto match the time boundaries of thedata.Curves derived in this way are called extended and are used primarily to visually inspect how the calculated baseline correlates with the
dataat timest < 0. This method is not used in any calculation and is introduced primarily because the search for the reverse solution of the heat problems only regards time value at , whereas in reality it may not be consistent with the experimental baseline value att < 0.- Parameters:
data- the experimental data, with a time range broader than the time range of thisHeatingCurve.baseline-- Returns:
- a new
HeatingCurve, extended to match the time limits ofdata
-
set
public void set(NumericPropertyKeyword type, NumericProperty property)
Callssuper.setand provides write access to theTIME_SHIFTproperty.- Overrides:
setin classAbstractData- Parameters:
property- the property of the typeNumericPropertyKeyword.NUMPOINTStype- must be equal toNumericPropertyKeyword.NUMPOINTS
-
listedKeywords
public Set<NumericPropertyKeyword> listedKeywords()
Description copied from class:AbstractDataListsNUM_POINTSas an accessible property of thisPropertyHolder.- Overrides:
listedKeywordsin classAbstractData- Returns:
TIME_SHIFTandNUM_POINTS.
-
remove
public void remove(int i)
Removes an element with the indexifrom all threeLists (time, signal, and baseline-corrected signal).- Overrides:
removein classAbstractData- Parameters:
i- the element to be removed
-
getTimeShift
public NumericProperty getTimeShift()
The time shift is the position of the 'zero-time'.- Returns:
- a
TIME_SHIFTproperty
-
setTimeShift
public void setTimeShift(NumericProperty startTime)
Sets the time shift and triggersTIME_ORIGIN_CHANGEDinCurveEvent. Triggers thefirePropertyChanged.- Parameters:
startTime- the new start time value
-
getInterpolation
public org.apache.commons.math3.analysis.UnivariateFunction getInterpolation()
-
addHeatingCurveListener
public void addHeatingCurveListener(HeatingCurveListener l)
-
removeListeners
public void removeListeners()
- Overrides:
removeListenersin classPropertyHolder
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractData- Returns:
trueonly ifois anAbstractDatacontaining all the elements of the time and signal lists ofthisobject.
-
interpolateSignalAt
public double interpolateSignalAt(double x)
-
-