find area of curve and update it with given conditions?
1 visualizzazione (ultimi 30 giorni)
I had a load curve (30 min interval 48 values) , and two different levels of curve(red, black horizontal line in pic), Now I want to find out the area of the curve, above the red line and below the black line, for each time stamp, Condition is such that,
If load>Red line
find Redarea for each segment/time stamp (RArea1,RArea2,RArea3,RArea4,RArea5, RArea6)
untill next segment: load<black line
find Yellow area (YArea1, YArea2, ...........YArea5)
untill RArea1+RArea2+RArea3+RArea4+RArea5+RArea6-YArea1-YArea2-YArea3........= zero or near to zero
if total area not zero condition, then futher calculate Green area in each segment untill the condition meet.
(Note: Uper area of red line take +ve and below black line is -Ve , so add segment wise with sign untill total area is near to zero)
then update the curve like following,
load <blaack line
load = black line
It should be updated only that untill where zero condtion meet, lets say conditon meet at 38th time stamp then further curve not changed according to above loop.
darova il 24 Set 2019
I'd like to interpolate data to get more points
% x,y - you data
x1 = linspace(x(1),x(end),more_points);
y1 = interp(x,y,x1);
Then use find() to find indices where y1>red
Use diff() to find/separate red and green areas
The same for yellow area
Did it help?