I have an array that is (219812,2)
but I need to split to 2 (219812)
.
I keep getting the error ValueError: operands could not be broadcast together with shapes (219812,2) (219812)
How can I accomplish?
As you can see, I need to take the two separate solutions from u = odeint and multiple them.
def deriv(u, t):
return array([ u[1], u[0] - np.sqrt(u[0]) ])
time = np.arange(0.01, 7 * np.pi, 0.0001)
uinit = array([ 1.49907, 0])
u = odeint(deriv, uinit, time)
x = 1 / u * np.cos(time)
y = 1 / u * np.sin(time)
plot(x, y)
plt.show()