Hi Guangyao,
You’re close! Since you’re using a Fourier series expansion in both x and y, one of the modes in the expansion varies like exp(i*0*x + i*0*y). We call that mode nx=0 and ny=0. For that mode, the x and y derivatives are both zero. In Dedalus, the
left-hand side of the equation is treated implicitly, which involves a matrix inverse. Singular matrix errors occur when the matrix associated with the left-hand side terms is singular.
What are the left-hand side of the equations for the nx=ny=0 mode?
dt(om) + k^2/Re*om = 0
om = 0
u = 0
v = 0
The problem is that you have two equations for om, and no equations for psi. You’ve put conditions on some of your equations, so taking into account the conditions, we have
u = 0
v = 0
u = 0
v = 0
Now you have two equations for u and v, but no equations for om or psi.
The way to fix the issue is to put a condition on the L(psi)+om=0 equation, and replace that equation with psi=0.