function y=As(x)

Ksp = 1e-20;
Ka1 = 5.62e-3;
Ka2 = 1.70e-7;
Ka3 = 3.95e-12;

y(1,1) = Ksp-x(1)*x(2);
y(2,1) = x(4)*x(5)-Ka1*x(3);
y(3,1) = x(4)*x(6)-Ka2*x(5);
y(4,1) = x(4)*x(2)-Ka3*x(6);
y(5,1) = x(1)-x(2)-x(5)-x(6)-x(3);
y(6,1) = x(4)-10^(-7.5);