I am trying to define the following system of ODES in python:
this way:
def rhs(t, P):
dP = np.zeros_like(P)
dP[0] = np.sqrt((1 - 3 / P) * (2 + 4 / P**2))
dP[1] = 1 / math.pow(P,2)
return dP
However, I am getting an error:
ValueError: setting an array element with a sequence.
I am not sure what is the problem... Would be grateful for any help with this!