There is no need to write pi(). pi takes no arguments. So just write it as pi, with no () following.
Anyway, the code above is not even valid. s0 is a scalar variable that takes on the value -1000. Yet you are trying to index the scalar s0 with some unknown/unsupplied variable or function called pnet.
There are various recommendations I might make. Perhaps using a contour plot to resolve the solution, IF one or more solutions do exist. Or you could use a tool like fsolve. Both of these approaches are far better solutions than a brute force nested loop as you have done.