Python Forum
fsolve - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: fsolve (/thread-9197.html)



fsolve - Mahdi1994 - Mar-26-2018

Hi, I'm going to plot each variables - x and y - over a period of time. Would you please help me?
Thank you.

def f(z):
    x = z[0]
    y = z[1]
    
    f = np.zeros(2)
    f[0] = 2*x**(2.0/3.0) + y**(2.0/3.0) - 9**(1.0/3.0)
    f[1] = x**2.0/4.0 + y**(1.0/2.0) - 1.0
    return f

z = fsolve(f, [1.0, 1.0])
print(z)