I'm getting familiar with fsolve in Python and I am having trouble including adjustable parameters in my system of nonlinear equations. This link seems to answer my question but I still get errors. Below is my code:
import scipy.optimize as so
def test(x,y,z):
eq1 = x**2+y**2-z
eq2 = 2*x+1
return [eq1,eq2]
z = 1 # Ajustable parameter
sol = so.fsolve(test , [-1,2] ,args=(z)) # Solution Array
print(sol) # Display Solution
The output gives
TypeError: test() missing 1 required positional argument: 'z'
When z is clearly defined as an argument. How do I include this adjustable parameter?