Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

NDSolve -- initial conditions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72968] NDSolve -- initial conditions
  • From: Michael Ederer <ederer at isr.uni-stuttgart.de>
  • Date: Sat, 27 Jan 2007 05:21:31 -0500 (EST)

Hello MathGroup,

For computation of initial conditions NDSolve uses somehow the simulation
time.

For example:
====
equ = {D[x1[t], t] == -10^5 * x1[t], x1[0] == 1}; 

NDSolve[equ, x1[t], {t, 0,  50}, "SolveDelayed" -> True]; 
NDSolve[equ, x1[t], {t, 0, 100}, "SolveDelayed" -> True]; 
---
The first NDSolve (simulation time 50) runs without errors,
but the second (simulation time 100) says:
  "NDSolve::icfail: Unable to find initial conditions which satisfy the
residual function within specified tolerances.  Try giving initial
conditions for both values and derivatives of the functions"
===

I use NDSolve for numerical simulation of nonlinear, stiff,
differential-algebraic equation systems of the form 
B(x) xdot = f(x) with singular B(x) (Method->IDA).
For this reason, I need the SolveDelayed-option and I often have simulation
times much larger than the fastest dynamics.
This often leads to problems with the above described behavior. 

To avoid this problem, I divide the whole simulation time into smaller parts
by using something like sd=NDSolve`ProcessEquations[..] and
NDSolve`Iterate[sd,t1], NDSolve`Iterate[sd,t2],.... with
t1<t2<... . However, then I very often get solutions that are non-continuous
at t1, t2, ... . So, this is not a good solution.

An alternative would be to follow the suggestion in the error message and
give initial conditions for the derivatives.
Those I would have to compute by using FindRoot. This is annoying, since
NDSolve could in principal find initial conditions for a smaller simulation
time. I would prefer if I could handle the  simulation and the computation
of initial derivatives solely using NDSolve.


So this is my question:
Is there any Option or different mechanism in NDSolve that controls the
numeric computation of initial conditions and initial derivatives? 
Could this option be used to prevent the "NDSolve::icfail" for systems with
partly very fast dynamics?


Thanks and best regards
Michael Ederer


P.S.: I use Mathematica 5.0


  • Prev by Date: Re: Module in a package
  • Next by Date: Sequence of Bernoulli RVs
  • Previous by thread: Re: Different results for same integration
  • Next by thread: Sequence of Bernoulli RVs