function [x,cost]=solve(x0,u,deltax,parameter)
% solves y=0=f(x,u)
%	x0 is the initial guess for the solution
%	u is an input vector of constants
%	x is the vector x that makes y=0
%	cost is the sum of the abs value of the 
%		elements of y
x = x0;
alpha = .5;
%
for i=1:20
	xold=x;
	y = fun(xold,u,parameter);
	j = jacob(xold,u,deltax,parameter);
	x = xold - alpha*inv(j)*y;
end
%
y=fun(x,u,parameter);
cost = sum(abs(y));
