I am working on combining a Generalized Weighted Residual Method with an RK4. The GWRM part decomposed the PDEs to the spectral space where the unknowns are Chebyshev coefficients a_k. However, I'm having difficulty seeing how the boundary conditions can be included in this case. In other Spectral methods, the physical grid is included and thus the boundary conditions can be set explicitly or included in the Chebyshev differentiation matrices. Here on the other hand the only information I have is the sum of the solution at the boundaries, but the boundary depends on the entire solution. So in each RK4 step the boundaries are never explicitly set.
Here is a short derivation of the ODE that I'm solving. Does anyone have any ideas on how the boundary conditions can be included?
Keep in mind A, b, and c are all vectors. Prime means first sum term is divided by 2.
P.s the resulting equations are ODEs which can be discretized with rk4.
This is my current understanding of how BCs are implemented but with each time step the solution gets further and further away from the true boundary conditions.
The Chebyshev coefficients at the highest modes K and K-1 can be substituted for boundary equations as such,