Linf<-160 k<-0.1 beta<-3 cond<-0.02 ages<-1:14 t0<-0 la<-Linf*(1-exp(-k*(ages-t0))) # Mean length at age la<-round(la,2) selF1<-0 selF2<-0.25 selF3<-0.35 selF4<-1.1 wa<-cond*la**beta/1000 # Mean weight at age in kg wa<-round(wa,2) s50<-5 # Age at 50% selection sa<-round(1/(1+exp(-1.1*(ages-s50))),2) # Selection at age p50<-5.5 pa<-round(1/(1+exp(-2*(ages-p50))),2) # Proportion mature at age M<-0.2 srfun<-function(Fmult,M,sa,wa,pa){ Fmort<-Fmult*sa Z<-Fmort+M Ztemp<-c(0,Z[1:(length(Z)-1)]) cumZ<-exp(-cumsum(Ztemp)) S<-sum(wa*pa*cumZ) return(S) }