My question is about how I can solve a coupled system of ODE's, and print out the variables in a plot.
I am solving for an q value and an e value, seen in this set of coupled ODE's below: $$ \begin{aligned} \frac{dq}{dt} &= \frac{48}{5\pi M^2}(2\pi Mq)^{11/3}e\frac{1+\frac{73}{24}e^2+\frac{37}{96}e^4}{(1-e^2)^{7/2}},\\ \frac{de}{dt} &= -\frac{304}{15M}(2\pi Mq)^{8/3}e\frac{1+\frac{121}{304}e^2}{(1-e^2)^{5/2}}. \end{aligned}$$
With my initial value for $e$ is 0.95 an my initial $q$ is 1, where constant $M$ = 1e9.
For my results, I want to plot q vs. e. I expect the e value to go to zero while q increases.
def q_e(x,t):
# M, a constant
M = 1e9
# q and e input assignment
q = x[0]
e = x[1]
# Eq.
dqdt = (48/(5*math.pi*M**2))*(2*math.pi*M*q)**(11/3)*((1+(73/24)*e**2+(37/96)*e**4)/(1-e**2)**(7/2))
dedt = -1*(304/(15*M))*(2*math.pi*M*q)**(8/3)*e*((1+(121/304)*e**2)/(1-e**2)**(5/2))
return [dfdt,dedt]
x0 = [1,0.95] # initial values q = 1, e = 0.99
t = np.linspace(0,100)
y = odeint(q_e,x0,t)
q = x[:,0] # output in sep. columns
e = x[:,1]
plt.plot(q,e)
#plt.semilogy(q,e) # test
I assumed that if I printed my q and e values, I could see where I got wrong. So I tried it,
print(y)
and got an output of
[[ 1.00000000e+00 9.50000000e-01]
[ 6.29120765e+05 3.44703571e-05]
[ 1.39158341e+02 4.86785907e+02]
[ 1.39158341e+02 4.86793360e+02]
Where the [ 1.39158341e+02 4.86793360e+02] repeats itself for many columns after for the length of $t$. It is somewhat positive to notice that the q and e values of [ 6.29120765e+05 3.44703571e-05] are normal.
I have tried messing around with my code, putting the e value instead of time t, but nothing is working. Looking for pointers and help, thanks!
ODEintWarning: Excess work done on this call (perhaps wrong Dfun type). Run with full_output = 1 to get quantitative information. warnings.warn(warning_msg, ODEintWarning)
. With this, I have tried to see what other differential type could be the problem, but have had no luck. $\endgroup$