% Function to be optimized:
% Author: K. Passino, Version: 5/16/00
function J=nutrientsfunc(theta,flag)

if flag==1  % Test to see if main program indicated nutrients
	J=0;
	return
end


% An example function to optimize:

	J=...
		+5*exp(-0.1*((theta(1,1)-15)^2+(theta(2,1)-20)^2))...
		-2*exp(-0.08*((theta(1,1)-20)^2+(theta(2,1)-15)^2))...
		+3*exp(-0.08*((theta(1,1)-25)^2+(theta(2,1)-10)^2))...
		+2*exp(-0.1*((theta(1,1)-10)^2+(theta(2,1)-10)^2))...
		-2*exp(-0.5*((theta(1,1)-5)^2+(theta(2,1)-10)^2))...
		-4*exp(-0.1*((theta(1,1)-15)^2+(theta(2,1)-5)^2))...
		-2*exp(-0.5*((theta(1,1)-8)^2+(theta(2,1)-25)^2))...
		-2*exp(-0.5*((theta(1,1)-21)^2+(theta(2,1)-25)^2))...
		+2*exp(-0.5*((theta(1,1)-25)^2+(theta(2,1)-16)^2))...
		+2*exp(-0.5*((theta(1,1)-5)^2+(theta(2,1)-14)^2));

