% This function computes the difference between a% frequency indepent quality factor and Q as function of% relaxation frequencies and tau (written for optimization with leastsq).functiondelta=qstd(x)globalLwQf1Qf2fl=x(1:L);t=x(L+1);% computing telaxation times and relaxation frequenciests=1./(2*pi*fl);% Q for a generalized standard linear solid:sumzQ=0;sumnQ=0;forl=1:L,d=1+w.*w*ts(l)*ts(l);sumnQ=(w*ts(l)*t./d)+sumnQ;sumzQ=((w.*w*ts(l)*ts(l)*t)./d)+sumzQ;endQf2=(1+sumzQ)./sumnQ;delta=(Qf2-Qf1);