Compact finite difference
I have some difficulty in understanding the implementation of compact difference schemes.
I understood that compact difference scheme gives a system of equations of the form Af' = Bf. Let's say if i intend to solve an equation of the form df/dt+c df/dx = 0. How do I implement the CDS in this equation? Is it by simply substituting for f'=A^(1)Bf in the discretized equation? 
Compact Difference
Compact difference is one way of getting higher order of accuracy with a relatively small stencil. As it is aware that if we want a higher order of accuracy the stencil size increases as the order of accuracy increases. Compact schemes requires to solve a tridiagonal system in the case of 1D and penta diagonal system in the case of 2D to get the coefficients of the variables getting into stencil. The key concept lies in the getting the coefficients. You should be careful once the boundary points are reached.

Thank you Ramesh.
The coefficients can be obtained by matching terms of same order. Once I do that I get a system of equations of the form Af' = Bf. How do I solve this equation since both f and f' are unknowns? 
Quote:
In the system, f is assumed to be the known term. Hence, start from assigned values f(x,0), compute f' and solve the equation df/dt + c f'=0. Repeat for each time step. Be careful in the BCs. 
Does that mean I have to simultaneously solve both the equations, and the scheme is implicit?

Quote:

All times are GMT 4. The time now is 17:20. 