New to Seeq... trying different things to see what works and reached the point where I need to ask for help!
I have a temperature signal representing the temperature inside of a vessel. I'm wanting to modify this signal for a user determined time frame each day representing a potential temperature delta between a vessel and a level bridle. I was hoping to get help on the following items:
1) Is there a more efficient method of doing this? Wanting to have a code that can be easily updated for time frames & rate of increase.
2) I had to use .move(5h) to shift the signal to start at midnight. How do I get it to start at the beginning of each day every day?
3) For some reason during the 11pm hour (hour 23) there is a short blip with a magnitude equaling the total temperature increase over the user specified time and I can't figure out why. For Example, starting at 10am the new temperature will be 1.25F greater than the trended signal ($t). The temperature continues to increase 1.25F per hour until 6pm for a total increase of 10F over the 8-hour duration. The blip starting at 11pm represents a 10F increase over roughly 15 minutes and then a 10F decrease in roughly the same time period.
Thanks in advance!
Code is as follows:
$TimeToIncrease = 10 //hour of day temperature starts increasing
$TimeToStopIncrease = 18 //hour of day temperatu re stops increasing
$TimeToStopDecrease = 21 //hour of day temperature stops decreasing
$IncreaseMultiplier = 1.25°F //Rate of increase per hour
$DecreaseMultiplier = (($TimeToStopIncrease-$TimeToIncrease)*$IncreaseMultiplier/($TimeToStopDecrease-$TimeToStopIncrease)).SetUnits('F') //Calcualted rate of decrease per hour
$DayHours = (hours().toSignal('Hour',startkey()).within(days()).move(5h)) //Had to move 5 hours to start at midnight. Hours()=0 was 7pm without this.
$Condition1 = ($DayHours >= $TimeToIncrease) And ($DayHours <=$TimeToStopIncrease)
$Condition2 = ($DayHours > $TimeToStopIncrease) And ($DayHours <=$TimeToStopDecrease)
$IncreaseTempSignal = $t+(($DayHours-$TimeToIncrease)*$IncreaseMultiplier).SetUnits('F')
$DecreaseTempSignal = $t+(($TimeToStopDecrease-$DayHours)*$DecreaseMultiplier).SetUnits('F')
$t
.splice($IncreaseTempSignal,$Condition1)
.splice($DecreaseTempSignal,$Condition2)