Jump to content

End Value of a Signal on the Previous Capsule of a Condition


Recommended Posts

Hello,

I have a signal which I integrate over a condition. Of course, it starts from zero for each capsule of the condition and integrates.

I need to create a signal with two terms being added: 
Signal=(Integral Signal)+(End Value of the Integral Signal at the Previous Capsule)

The signal can reset to zero at the start of each month.

i.e. Pin 3 at the screenshot below is placed at the end of the first capsule of the May (it seems like the first capsule extends back to the previous month but it is actually split at the end/start of month), the value is 10.787 h. I want the next integration through the next capsule to shift up in the y-axis by 10.787 h. And the 3rd capsule to shift up by whatever the result of 2nd capsule would be and so on until the end of the month, resetting to zero only at the start of each month.

Would you recommend a way to achieve this?

image.thumb.png.86e25821bc464c5d5b67f3c6bdc76295.png 

Link to comment
Share on other sites

  • 2 weeks later...

Hello again,

In the same case, there is a condition (say condition A) that lights up sometimes, creating capsules in between purple capsules in Thorsten's example. I want to add a constant value (say +3) to the running sum of the running delta If A lights up in between the purple condition's capsules. Would you recommend a solution for this? 

Best Regards,

Emre

Link to comment
Share on other sites

Hi Emre, 

one way to achieve this would be counting the conditions and multiply them with you constant. This signal is then added to the other signal:

$signal.setMaxInterpolation(20d).runningdelta().runningSum(months('CET')) +
$conditionA.aggregate(count(), $conditionA, startKey(), 0s).runningCount(months('CET')).toStep(30d) * 3

The second term of the formula will calculate the number of capsules during each capsule (which is 1) and put that as a discrete value to the start of the capsule. This value will be summed up during the month, transformed to a step signal and multiplied with the constant.
The screenshot shows the previous calculation (red) together with the new calculation (blue). Condition A is represented by the green capsules.
image.thumb.png.4d44ed3961f9f02f56b718e394b898f6.png

Regards,

Thorsten

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...