I want to solve a system of 7 coupled differential equations and 1 algebraic equation in MATLAB with the method of lines. I could do it for each independent equation with some assumptions, but I can't solve these 8 equation together. Can you help me?
What you describe is called Differential-Algebraic Equation (DAE) system. Depending on the index of the system, these can be easy to solve or very hard. Take a look at: http://www.mathworks.com/matlabcentral/fileexchange/7481-manuscript-of--solving-index-1-daes-in-matlab-and-simulink-
Solvers ode15s and ode23t of Matlab can handle index-1 DAEs. If the system is stiff, ode15s is more suitable.
If you are interested in the theory behind them, or what is index and stiff, take a look at: http://www.scholarpedia.org/article/Differential-algebraic_equations
Edit: I didn't realize the OP was asking specifically for the method of lines. There is a section about DAEs here: http://www.scholarpedia.org/article/Method_of_lines