I want to solve 7 coupled equations.I use method of line(MOL) and discrete the equation in Length and radius and convert them to a system of ODEs in time.and use ode15s to solve them in MATLAB. But an error occur:

Warning: Failure at t=5.422028e-006. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.355253e-020) at time t.

It means that equations are too stiff. How can i solve them? Is there another method? The equations are true.I am sure.

  • 1
    $\begingroup$ Definitely make sure you don't have any programming errors in your equations. $\endgroup$ – spektr Dec 29 '15 at 21:24
  • $\begingroup$ @ choward How can i do that?its the first time i use MOL.CAN you guide me what error will occur? $\endgroup$ – fatemeh Dec 30 '15 at 5:58
  • $\begingroup$ I think the best thing you can do is clean up your code for the MOL part and paste it on here so we can check it out $\endgroup$ – spektr Dec 30 '15 at 7:02
  • $\begingroup$ @ choward i added code in main question.Thanks alot. $\endgroup$ – fatemeh Dec 30 '15 at 10:04
  • 1
    $\begingroup$ @fatemeh: re: posting code, I'd say a better practice is to break your code up into small testable units for debugging so that you can diagnose bugs and fix them quickly. Diagnosing is the hard, time-consuming part, and while posting your code does provide SciComp users with some of the information needed to investigate the issues you're having, it requires a lot of work to figure out the root of the actual problem. If you can identify the numerical issue yourself, and make that the core of your question, you are more likely to receive more actionable responses. (BillGreene's is good.) $\endgroup$ – Geoff Oxberry Jan 7 '16 at 3:13

ode15s is designed to handle stiff systems of ODEs so I doubt if the problem you are encountering is that your "equations are too stiff"

It is more likely that your spatial discretization has an error for some reason or your have some other MATLAB programming error. I suggest the following approach to debug this: Set the final integration time for ode15s to be something smaller than that when the failure occurs: say 5.2e-6 (I am assuming the starting time is zero). Make sure you have enough output times in that interval so you can produce reasonable plots of your dependent variables at key points in your spatial mesh as a function of time.

My guess is if you look at these plots you will see that one or more of your dependent variables is going to infinity or -infinity as you approach the final time. That should give you a clue as to which equation(s) are causing problems for ode15s.

  • $\begingroup$ .i doubt if discretization is true or not.can i send my program here?or can you guid me? $\endgroup$ – fatemeh Dec 30 '15 at 5:56
  • $\begingroup$ i added my code to main question $\endgroup$ – fatemeh Dec 30 '15 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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