Finding the area under a curve (Integral)

Hello,

 

I have a PI tag thats giving a value every couple of minutes and I would like to plot those values and calcualte the area under the curve. How can I do that in PI Asset Framework?

 

So, first getting the equation of a line y=mx+b then using that for the integral over time

 

Thank you,

 

Parents
  • As I understand it, you would like to calculate area under the curve using AF analysis and output the area as a value when initial tag changes... this will be a combination of analysis steps.

    Something to keep in mind, I'm assuming x is the timestamp of the tag value, you will need to convert it to something meaningful, like "seconds since midnight" to get an integer value.

    Variables

    y=current tag value

    m = slope

    x = current tag value's "meaningful" timestamp

    y0 = previous tag value

    x0 = previous tag value's "meaningful" timestamp

    dy = delta y = y - y0

    dx = delta x = x - x0

     

    To use an integral over a line (y=mx+b) you'd follow these analysis steps:

    1) Solve for m => m = dy/dx

    2) Solve for b => b = y - mx

    3) Area = integral from x0 to x of "mx + b"


    image.png
    or


    image_1.png
     

     

     

     

  • Thank you very much!

    I am having trouble getting the 'meaninful' tag timestamp... Lets say I have a current value of 10 PSIG @ 3 : 05 PM and 15 PSIG @ 3:10 PM then whats my 'Meaninful' timestamp here ? how do I get it ?

Reply Children
No Data