MathGroup Archive 2008

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

Search the Archive

Re: Specifiying finiteness condition using NDSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85245] Re: Specifiying finiteness condition using NDSolve
  • From: bghiggins at ucdavis.edu
  • Date: Mon, 4 Feb 2008 03:10:16 -0500 (EST)
  • References: <fnrnir$ohl$1@smc.vnet.net>

On Jan 30, 9:50=A0pm, pradeep <prad... at purdue.edu> wrote:
> Hello all,
> I am trying to solve a PDE for unsteady laminar flow through a circular
> tube using NDSolve, but am having difficulty in implementing one of the
> boundary conditions which states that the velocity at all time, at r=0
> (centre of the tube), is FINITE. How do I specify the fact that the
> function i am solving for has a value that is finite at a specific point
> in the domain in mathematica?
>
> Thanks in advance!
>
> Pradeep
> Purdue University

Pradeep,

I presume you are trying to solve the following linear PDE, where x is
the radial coordinate

D[u[t, x], t] == 1 +  D[u[t, x], x, x] + D[u[t, x], x]/x

and the difficulty is the term with 1/x which becomes indeterminate at
x=0.  If you apply l'Hopital's rule you find that the appropriate PDE
at x=0 is

D[u[t, x], t] == 1 +  2 D[u[t, x], x, x]   at  x=0

Thus to solve this system of PDEs we construct the following helper
functions

g1[x_ /; x > 0] := 1
g1[x_ /; x == 0] := 2
g2[x_ /; x > 0] := 1/x
g2[x_ /; x == 0] := 0


sol = NDSolve[{D[u[t, x], t] ==
    1 + g1[x] D[u[t, x], x, x] + g2[x] D[u[t, x], x], u[0, x] == 0,
   Derivative[0, 1][u][t, 0] == 0, u[t, 1] == 0}, u, {t, 0, 10}, {x,=

0, 1}]

And here is a plot of the solution at various time intervals

Plot[Evaluate[{u[0.02, x], u[0.08, x], u[0.1, x], u[0.4, x], u[1, x],
    u[5, x]} /. sol], {x, 0, 1}]

Cheers,

Brian






  • Prev by Date: Re: How edit a saved palette?
  • Next by Date: Re: Efficient way of reading matrices
  • Previous by thread: Re: Default definition of VertexRenderingFunction
  • Next by thread: pattern matching against the Dt function?