the terms on the right-hand side of the equation are known, this is a tridiagonal problem, so that may be efficiently solved by using the tridiagonal matrix algorithm in favor over the much more costly matrix inversion. A quasilinear equation, such as (this is a minimalistic example and not general) would lead to a nonlinear system of algebraic equations, which could not be easily solved as above; however, it is possible in some cases to linearize the problem by using the old value for , that is, instead of . Other times, it may be possible to estimate using an explicit method and maintain stability. Example: 1D diffusion with advection for steady flow, with multiple channel connections This is a solution usually employed for many purposes when there is a contamination problem in streams or rivers under steady flow conditions, but information is given in one dimension only. Often the problem can be simplified into a 1-dimensional problem and still yield useful information. Here we model the concentration of a solute contaminant in water. This problem is composed of three parts: the known diffusion equation ( chosen as constant), an advective component (which means that the system is evolving in space due to a velocity field), which we choose to be a constant Ux, and a lateral interaction between longitudinal channels (k): where C is the concentration of the contaminant, and subscripts N and M correspond to previous and next channel. The Crank–Nicolson method (where i represents position, and j time) transforms each component of the PDE into the following: Now we create the following constants to simplify the algebra: and substitute (), (), (), (), (), (), α, β and λ into (). We then put the new time terms on the left (j + 1) and the present time terms on the right (j) to get To model the first channel, we realize that it can only be in contact with the following channel (M), so the expression is simplified to In the same way, to model the last channel, we realize that it can only be in contact with the previous channel (N), so the expression is simplified to To solve this linear system of equations, we must now see that boundary conditions must be given first to the beginning of the channels: : initial condition for the channel at present time step, : initial condition for