%Program: Find max power
function p=findmaxpower(xl,xr,yb,yt,M,N,K,a,b)
p=[];
format long
for P=a:0.01:b;
    w=poisson_inputpower_half(xl,xr,yb,yt,M,N,P,K);
    max_w_col=max(w);
    max_w=max(max_w_col);
    ca=[P max_w];
    if max_w<=80;
        p=cat(1,p,ca);
    else
        break;
    end
end

