Quote:
Originally Posted by shaileshdhutekar hi all..
actually my code is taking too long to run.i am numerically
integrating equation using quad.i think reason behind code taking
so much time is that there are lot of singularities coming while
integrating the expression.So while going thro' these
discontinuities ODE45(i also used) is taking very small steps and
hence it is taking hours to run the code.
possible solution to thses kind of stiff equations is to use ODE15s.I
tried that too but its accuracy is far too low and hence it is not
showing appropriate results.
If u have any other solution to this problem ..plz suggest me.
thank U! |
Where are they and what type of singularities are we talking about here?
In general I would switch to a fixed step length method (in fact Euler or a simple predictor corrector based on Euler) and use a small step.
(and possibly use a number of step lengths and look at how the answer changes with step length and then consider Richardson extrapolation).
CB