def shoot(s,n,plotsol=False):
maxiter, TOL = 100, 1.0e-8
x = linspace(-1.0,1.0,n+1)
if plotsol:
figure(figsize=(8,5))
xe = linspace(-1.0,1.0,1000)
ye = yexact(xe)
plot(xe,ye,label="Exact")
it = 0
while it < maxiter:
p, dp, u = solvephi(n,s)
if plotsol:
plot(x,u[:,0],label=str(it))
if abs(p) < TOL:
break
s = s - p/dp
it += 1
print('%5d %16.6e %16.6e'%(it,s,abs(p)))
if plotsol:
legend(); grid(True)
return s,p,x,u