Skip to content
Prev 308146 / 398503 Next

Penalty function constrained optimization

perhaps:

obj<-function(f){
    f <- array(f, dim=c(nfleets, nareas)) # just for clarity
    F <- q*f
    Z <- M+sum(F)
    S <- exp(-Z)
    Catch<- N*F/Z*(1-S)
    Tot.Catch <- sum(Catch)
    NR<-array(0,dim=c(nfleets,nareas))
    NR<-Price*Catch - f*cost
    d.NR<-array(0,dim=c(nfleets,nareas))
    f <- apply(f, 1, sum) ##### sum effort for each fleet
    d.NR<- N*q/Z*(1-S-F/Z+F/Z*S+F*S)*Price - cost + 1000*max(0,(f-9))^2
    return(sum(d.NR*d.NR))
}
On Wed, Oct 17, 2012 at 5:06 AM, hayduke <cusackc at onid.orst.edu> wrote: