recording singularities of NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg80500] recording singularities of NDSolve
- From: "Judith Bunder" <bunder at phys.cts.nthu.edu.tw>
- Date: Thu, 23 Aug 2007 06:23:37 -0400 (EDT)
Hi,
I have to solve a system of simultaneous equations and I have to solve them
several times with varying initial conditions. I use something like this:
Do[{c1 = i/imax, c2 = j /jmax,
sol[i, j] = First@NDSolve[eqns, coup, {t, 0,
100}]}, {j, 1, 5}, {i, 1, 5}]
So, I solve the the problem 25 times with 5 different j values and 5 different
i values. The variables c1 and c2 are the variable initial conditions. I have
no problems with this part.
My problem is, sometimes the solution diverges. This is good, I'm looking for
divergent points. But, I want some method of recording where the solution
diverges. I get the warning messages:
NDSolve::ndsz At t=18.28484703670573` step size is effectively zero;
singularity or stiff system suspected.
so I could manually record this value of t. But, this isn't practical as
several of my 25 solutions are usually divergent (and I also need to record
the value of i and j). Is there any way to define something like t-div[i,j]
which will record all these points where my solution diverges?
Thanks in advance,
Judy