function [K]=compK(w) global r L alpha N; for i=1:N K(i,1)=(w(i)/r)*L(i)*(1-alpha(i))/alpha(i); end