So I'm building a SIQRA epidemic model simulation on Python and can't really figure out why my code only works when I add .T after calling my function in the last line:
# A grid of time pofloats
t = np.linspace(0, 10)
# The SIQRA model differential equations
def SIQRA(y, t, N, beta, delta, alfa, sigma, omega,
alfaSA, alfaIA, alfaQA):
S, I, Q, R, A = y
dSdt = -alfaSA * S * A - beta * S * I + sigma * R + omega * Q
dIdt = beta * S * I - alfaIA * A * I - delta * I
dQdt = delta * I - omega * Q - alfaQA * Q - alfa * Q
dRdt = alfa * Q - sigma * R
dAdt = alfaSA * S * A + alfaIA * A * I + alfaQA * Q
return dSdt, dIdt, dQdt, dRdt, dAdt
# Initial conditions vector
y0 = S0, I0, Q0, R0, A0
# Integrate the SIQRA equations over the time grid, t
ret = odeint(SIQRA, y0, t, args=(N, beta, delta, alfa,
sigma, omega, alfaSA, alfaIA, alfaQA))
S, I, Q, R, A = ret.T
I know it has something to do with the matrix it creates but I can't really figure it out completely.