MathGroup Archive 2003

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

Search the Archive

Re: NDSolve and derivative error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg41421] Re: NDSolve and derivative error
  • From: "Kevin J. McCann" <KevinMcCann!kjm at uunet.uu.net>
  • Date: Mon, 19 May 2003 05:09:40 -0400 (EDT)
  • References: <ba7ho3$5en$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

This works for me.



r=2.5*10^-6;

nsol = NDSolve[{0.005*x[t]*Derivative[1][x][t] == 0.148 +
0.00005*UnitStep[t] - (0.006*x[t]*Derivative[1][x][t])/r, x[0] == 10^(-6)},
x[t], {t, 0, 0.05}, AccuracyGoal -> 20, WorkingPrecision -> 25, MaxSteps ->
Infinity][[1]]

Plot[x[t]/.nsol,{t,0,0.05}];

"Racer X" <rajduc at yahoo.com> wrote in message
news:ba7ho3$5en$1 at smc.vnet.net...
>
> Hi Kevin,
>
> Sorry Kevin, thought I'd substituted all the
> constants.  r is equal to 2.5e-6.
>
> Raj
>
> --- "Kevin J. McCann" <kjm at KevinMcCann.icomcast.net>
> wrote:
> > On the RHS you have 0.006/r. What is r?
> >
> >
> > "Racer X" <rajduc at yahoo.com> wrote in message
> > news:ba50fq$s9s$1 at smc.vnet.net...
> > >
> > > Hi,
> > >
> > > I have been using Mathematica on and off for about
> 10
> > > years, but am not really an expert.  I have been
> > > unable to get beyond this problem:
> > >
> > > NDSolve[{0.005*x[t]*Derivative[1][x][t] == 0.148 +
> > > 0.00005*UnitStep[t] -
> > > (0.006/r)*x[t]*Derivative[1][x][t], x[0] ==
> 1.*^-6},
> > > x, {t, 0, 0.05}, AccuracyGoal -> 20,
> WorkingPrecision
> > > -> 25, MaxSteps -> Infinity]
> > >
> > > I get the following error:
> > >
> > > NDSolve::"ndnum" : "Encountered non-numerical
> value
> > > for a derivative at t == \0."
> > >
> > > This problem relates to the speed which water will
> > > rise in a capillary tube.  It has an analytical
> > > solution, but I want to be able to vary the
> UnitStep
> > > input to an arbitrary pulse and need the above to
> > > work.
> > >
> > > Any suggestions?  Thanks!
> > >
> > > Raj
>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>




  • Prev by Date: Re: Interpoint distances---timing comparisons
  • Next by Date: RE: Re: any good tutorials?
  • Previous by thread: Re: NDSolve and derivative error
  • Next by thread: Boundary Conditions for NDSolve