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?

  • 1
    $\begingroup$ Welcome to SciComp.SE. You are not providing enough information for people to help you. You can add the system of equations of interest for a starter. $\endgroup$
    – nicoguaro
    Sep 18, 2015 at 15:51
  • 1
    $\begingroup$ Also, please try to write posts with good spelling and grammar. $\endgroup$
    – nicoguaro
    Sep 18, 2015 at 15:52
  • $\begingroup$ Also, you could provide context and motivation. Are you going to spend $100 of your own money building a balsa-wood bridge using this, or are you asking folks to do your homework? What kind of answer is going to be most valuable - one that "cuts to the chase" or one that "gives step by step" so you can generalize the approach? $\endgroup$ Sep 18, 2015 at 22:35

1 Answer 1


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

  • $\begingroup$ Thanks a lot. I used this method for solving equations but now i have a problem for Function definition. I dont know how definite 7 coupled equations in one function. Can you help me? $\endgroup$
    – fatemeh
    Oct 3, 2015 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.