Dear all,
These days I met a problem to create the matrx P to link two state vectors q1 and q2, where q1 includes the degree of freedom about the velocity and pressure, while q2 only the degree of freedom about the velocity. The rectangle matrix P can remove the pressure-related dof in the q1.

How could I make the matrix P and output it from the FreeFem++?
Thanks very much !

Thanks for your reply， but I want to do flow instability analysis A(q1)=(omega)B(q1), and I get matrix A and B for the lineariszed NS equation with defined ‘varf’. But now I want to do A(q1)=(omega)B(q1)+(P’)(q2), so l need the matrix for P. It seems that I can not define a ‘varf’ with two different fespace…

And I can’t define a rectangle matrix with only 0 and 1, because I think P includes the mass matrix of fem… or I need to define both P and M(mass matrix of fem) so that A(q1)=(omega)B(q1)+(P’)(M)(q2), so that P only includes 0 and 1. But I don’t know how to only set the dof of pressure is 0, because I don’t know how the dof is ordered in the vectro q1.