I am attempting to use sympy to generate an implicit scheme for the heat equation. With the Crank-Nicolson time discretization I have equation 1 (attached).
Is there any way to isolate all occurrences of $\rho^{n+1}$ (along with its derivatves) to the lefthand side, as in equation 2 (attached).
I would be very interested to know! Apparently it has something to do with the collect function.
Best,
Jonathan