Thu, 07/29/2010 - 02:42 am
Hi there, I try to automatize the calculation of the weight difference of a silo for certain time periods. The signal of the silo weight is shown in the attached image. There are always time periods of charging (weight increase: almost a step function) and discharging the silo (slow weight decrease). I'm interested in how much of the charged matter was used between two charges of the silo. Until now I made this manually. Then I tried the PeakFind. Min and Max etc. functions in IGOR, but didn't get a good result.
Does somebody have an idea?
Thank you...K.
July 29, 2010 at 03:18 am - Permalink
Maybe the following function does what you want:
wave silo
make/n=0/o/free usage_tmp,usageX_tmp
variable i=0,mmin=pnt2x(silo,0),mmax=pnt2x(silo,numpnts(silo)-1),V_max2
Differentiate silo/D=silo_diff
findpeak/q/r=(mmin,mmax)/m=(0.1*silo_diff(mmin)) silo_diff
V_max2=wavemax(silo,mmin,V_LeadingEdgeLoc)
do
if(V_flag!=0)
killwaves/z silo_diff
extract/o usageX_tmp,usageX,usage_tmp>0
extract/o usage_tmp,usage,usage_tmp>0
return 0
endif
wavestats/q/r=(mmin,V_LeadingEdgeLoc) silo
usage_tmp[i]={V_max2-V_min}
usageX_tmp[i]={V_minloc}
wavestats/q/r=(V_LeadingEdgeLoc,V_TrailingEdgeLoc) silo
V_max2=V_max
mmin=V_TrailingEdgeLoc
findpeak/q/r=(mmin,mmax)/m=(0.1*silo_diff(V_maxloc)) silo_diff
i+=1
while(1)
end
July 29, 2010 at 07:08 am - Permalink