Click here to Skip to main content
15,911,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Python
from scipy.optimize import fsolve


def f(z):
	x= z[0]
	y= z[1]
	return [x+2*y, x**2+y**2-1]
	
z0 = [0,1]
z = fsolve(f,z0)
print(z)
print(f(z))


and plz tell me the difference between print(z) & print(f(z))

What I have tried:

Plz help me
Python
from scipy.optimize import fsolve


def f(z):
	x= z[0]
	y= z[1]
	return [x+2*y, x**2+y**2-1]
	
z0 = [0,1]
z = fsolve(f,z0)
print(z)
print(f(z))


and plz tell me the difference between print(z) & print(f(z))
Posted
Updated 22-Aug-17 2:52am
v3
Comments
PIEBALDconsult 21-Aug-17 23:16pm    
z0 is an array?
What's fsolve?

1 solution

From the documentation of fsolve()[^]: z0 is the initial guess for the root (zero point) of function f(z). print(z) outputs the root found by fsolve() and print(f(z)) outputs the value of the function at z (should be zero).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900