I have this system of equations in sympy:
m1, m2 = symbols('m1, m2', real=True, positive=True)
t0, t = symbols('t0 t', real=True, positive=True)
p1, p2, v1, v2, a1, a2, f1, f2 = symbols('p1 p2 v1 v2 a1 a2 f1 f2', cls=Function)
G = 6.67384e-11
eq1 = Eq(f1(t), G * m1 * m2 * (p2(t) - p1(t)) / abs(p2(t) - p1(t)))
eq2 = Eq(a1(t), a1(t0) + (1/m1) * Integral(f1(t), (t, t0, t)))
eq3 = Eq(v1(t), v1(t0) + Integral(a1(t), (t, t0, t)))
eq4 = Eq(p1(t), p1(t0) + Integral(v1(t), (t, t0, t)))
eq5 = Eq(f2(t), G * m1 * m2 * (p1(t) - p2(t)) / abs(p2(t) - p1(t)))
eq6 = Eq(a2(t), a2(t0) + (1/m2) * Integral(f2(t), (t, t0, t)))
eq7 = Eq(v2(t), v2(t0) + Integral(a2(t), (t, t0, t)))
eq8 = Eq(p2(t), p2(t0) + Integral(v2(t), (t, t0, t)))
I want to have sympy solve these equations for p1(t) and p2(t) in terms of t, but if I use this:
results = solve([eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8],
[p1(t), p2(t)])
I simply get p1(t) and p2(t2) in terms of v1(t) and v2(t):
p1(t0) + Integral(v1(t), (t, t0, t))
p2(t0) + Integral(v2(t), (t, t0, t))
If I use this:
results = solve([eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8],
[p1(t), p2(t), v1(t), v2(t), a1(t), a2(t), f1(t), f2(t)])
I get:
p1(t0) + Integral(v1(t0) + Integral(a1(t), (t, t0, t)), (t, t0, t))
p2(t0) + Integral(v2(t0) + Integral(a2(t), (t, t0, t)), (t, t0, t))
(I've omitted the results for the other functions because they're very long.)
How can I make sympy to calculate the results for p1(t) and p2(t) in pure terms of t?