MathGroup Archive 2008

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

Search the Archive

RE: RE: Re: Partial differential equation with evolving boundary conditions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91564] RE: [mg91528] RE: [mg91498] Re: Partial differential equation with evolving boundary conditions
  • From: "Ingolf Dahl" <ingolf.dahl at telia.com>
  • Date: Wed, 27 Aug 2008 06:43:58 -0400 (EDT)
  • References: <g8o868$l6k$1@smc.vnet.net> <200808241105.HAA15454@smc.vnet.net> <200808251055.GAA27291@smc.vnet.net> <48B2C3B2.7070503@wolfram.com>
  • Reply-to: <ingolf.dahl at telia.com>

Hi again,
I have thought about this problem a bit more. My problem can be seen as an
example of a general initial-value problem:;

Assume that we have a state vector psi[t] for a system.
Assume further that the initial value psi[0]== psi0 is known.
Assume also that the time derivative (d/dt) psi[t] is known, and that it is
a function f[psi[t]].

Then we should in a quite general case be able to find the solution psi[t],
even if psi should be an aggregate of the type
psi[t]={f1[t],f2[x,t],f3[x,y,t]} or something of that kind.
(Would NDSolve manage such a state vector?). There are of course a lot of
pathological cases possible, but it should be able to write a general solver
in Mathematica for the other cases.

Inspired by this, I have modified my problematic case. Now I only have to
suppress a warning "NDSolve::bcart: Warning: An insufficient number of
boundary conditions have been specified for the direction of independent
variable y. Artificial boundary effects may be present in the solution", but
the solution looks OK to me by first inspection. I have used the Which
command to include the boundary conditions at y == 0 and y == 1 in the 
differential equation. In this way I also avoid Jens-Peer Kuskas argument 
"It is mathematical necessary because otherwise you have 
at the boundary *two* differential equations for the t-dependence 
and both can't be satisfied." As is common for differential equation, we
will 
have one condition valid in the interior of the interval, and another at the

border, nothing magic or special about this. The Derivative[2,
0][\[Theta]][y, t]
term in the interior should keep the function continuous and smooth
everywhere. 

Manipulate[
   s = Quiet[
   NDSolve[{Which[y == 0, -\[Theta][y, t]/\[Lambda]s, y == 1, 
                -\[Theta][y, t]/\[Lambda]s, 
       True, (Derivative[2, 0][\[Theta]][y, t] + 
                     
          elecy[t, dutycycle, emax]*(5 - \[Theta][y, t])*y*(1 - y))/
                  \[Lambda]] == D[\[Theta][y, t], t], \[Theta][y, 0] == 
      0}, \[Theta], {t, 0, 2}, 
          {y, 0, 1}], {NDSolve::bcart}]; 
 Plot3D[\[Theta][y, t] /. s, {y, 0, 1}, 
      {t, 0, 2}, PlotStyle -> Automatic, PlotRange -> {-1, 5}], 
   {{emax, 50., "emax"}, 0, 100, Appearance -> "Labeled"}, 
   {{dutycycle, 0.25, "dutycycle"}, 0, 1, Appearance -> "Labeled"}, 
   {{\[Lambda], 1., "\[Lambda]"}, 0.001, 10, 
  Appearance -> "Labeled"}, 
   {{\[Lambda]s, 1., "\[Lambda]s"}, 0.001, 10, 
  Appearance -> "Labeled"}, 
   Initialization :> (elecy[t_, dutycycle_, emax_] := 
        Which[0 <= Mod[t, 1] <= dutycycle, emax, 
     Inequality[dutycycle, 
            Less, Mod[t, 1], LessEqual, 1], 0.]), 
 ContinuousAction -> False, 
   ControlPlacement -> Top]

We might obtain a more interesting case by introduction of a coupling 
from the interior to the boundary. Then we can really see the effects 
of the parameter \[Lambda]s :

Manipulate[
   s = Quiet[
   NDSolve[{Which[y == 0, (Derivative[1, 0][\[Theta]][y, t] - 
                     \[Theta][y, t])/\[Lambda]s, 
       y == 1, (-Derivative[1, 0][\[Theta]][y, t] - 
                     \[Theta][y, t])/\[Lambda]s, 
       True, (Derivative[2, 0][\[Theta]][y, t] + 
                     elecy[t, dutycycle, emax]*
           (5 - \[Theta][y, t])*y*(1 - y))/\[Lambda]] == 
      D[\[Theta][y, t], t], \[Theta][y, 0] == 0}, \[Theta], {t, 0, 
     6}, 
          {y, 0, 1}], {NDSolve::bcart}]; 
 Plot3D[\[Theta][y, t] /. s, {y, 0, 1}, 
      {t, 0, 6}, PlotStyle -> Automatic, PlotRange -> {-1, 5}], 
 {{emax, 50., "emax"}, 0, 100, Appearance -> "Labeled"}, 
   {{dutycycle, 0.25, "dutycycle"}, 0, 1, Appearance -> "Labeled"}, 
   {{\[Lambda], 1., "\[Lambda]"}, 0.001, 10, 
  Appearance -> "Labeled"}, 
   {{\[Lambda]s, 1., "\[Lambda]s"}, 0.001, 10, 
  Appearance -> "Labeled"}, 
   Initialization :> (elecy[t_, dutycycle_, emax_] := 
        Which[0 <= Mod[t, 1] <= dutycycle, emax, 
     Inequality[dutycycle, 
            Less, Mod[t, 1], LessEqual, 1], 0.]), 
 ContinuousAction -> False, 
   ControlPlacement -> Top]  
  
Similar problems with soft boundary conditions are quite common in 
applied mathematics, what I can understand.

I have pasted back the code into Mathematica before posting this, and 
it seems to work. Hopefully it works for you too.

Ingolf Dahl  

> -----Original Message-----
> From: Daniel Lichtblau [mailto:danl at wolfram.com] 
> Sent: den 25 augusti 2008 16:38
> To: Ingolf Dahl
> Cc: mathgroup at smc.vnet.net
> Subject: Re: [mg91528] RE: [mg91498] Re: Partial differential 
> equation with evolving boundary conditions
> 
> Ingolf Dahl wrote:
> > Hi Jens-Peer,
> > Thanks for your interest and your comments
> > 
> > My problematic code was a little damaged by the 
> copy-and-paste. I try again:
> > 
> > Manipulate[s = NDSolve[{emax; dutycycle;
> >     \!\(
> > \*SubscriptBox[\(\[PartialD]\), \(y, y\)]\ \(\[Theta][y, t]\)\) + 
> >       elecy[t]*(5 - \[Theta][y, t])*y*(1 - y) == \[Lambda]*\!\( 
> > \*SubscriptBox[\(\[PartialD]\), \(t\)]\(\[Theta][y, t]\)\),
> >      \[Theta][0, t] == -\[Lambda]s*\!\( 
> > \*SubscriptBox[\(\[PartialD]\), \(t\)]\(\[Theta][0, t]\)\),
> >     \[Theta][1, t] == -\[Lambda]s*\!\( 
> \*SubscriptBox[\(\[PartialD]\), 
> > \(t\)]\(\[Theta][1, t]\)\), \[Theta][
> >       y, 0] == 0}, \[Theta], {y, 0, 1}, {t, 0, 2}];  
> > Plot3D[\[Theta][y, t] /. s, {y, 0, 1},
> >   {t, 0, 2}, PlotStyle -> Automatic, 
> >   PlotRange -> {0, 5}],
> >  {{emax, 25., "emax"}, 0, 100, 
> >   Appearance -> "Labeled"}, 
> >   {{dutycycle, 0.25, "dutycycle"}, 0, 1, 
> >   Appearance -> "Labeled"},
> >  {{\[Lambda], 1., "\[Lambda]"}, 0.001, 10, 
> >   Appearance -> "Labeled"},
> >  {{\[Lambda]s, 1., "\[Lambda]s"}, 0.001, 10, 
> >   Appearance -> "Labeled"},
> >  Initialization :> (elecy[t_] :=
> >     Which[0 <= Mod[t, 1] <= dutycycle, emax, 
> >      dutycycle < Mod[t, 1] <= 1, 0.]),  ContinuousAction -> False, 
> > ControlPlacement -> Top]
> > 
> > Interleaved comments to your answer follow below
> > 
> > Best regards
> > 
> > Ingolf Dahl
> >  
> > 
> >> -----Original Message-----
> >> From: Jens-Peer Kuska [mailto:kuska at informatik.uni-leipzig.de]
> >> Sent: den 24 augusti 2008 13:06
> >> To: mathgroup at smc.vnet.net
> >> Subject: [mg91498] Re: Partial differential equation with evolving 
> >> boundary conditions
> >>
> >> Hi,
> >> [...]
> 
> >> c) this is inconsistent with \[Theta][y,0]==0 and no soulution
> >>     would exist.
> > 
> > and then with integrationconstant0 = integrationconstant1 = 
> 0 there is 
> > trivial consistence with \[Theta][y,0]==0
> 
> One can have a pointwise boundary discontinuity or, more 
> generally, a singularity of dimension less than that of the 
> boundary. Mathematica might complain, but offhand I don't see 
> an issue with the mathematics.
> 
> 
> >> d) the classical way is to think about the existence and uniqueness
> >>     of the solution *before* a analytical or numeric solution
> >>     is attempt.
> > 
> > Sometimes I prefer other ways, all roads should lead to Rome. 
> > Sometimes it is very illuminating to try to find a constructive 
> > solution. In this way I was able to formulate a question 
> appropriate 
> > for MathGroup, where all answers use to be nice.
> > 
> > But with \[Theta][0, t]==0 and  \[Theta][1, t] == 0 there 
> should exist 
> > solutions, and thus also in this case(?) I do not think 
> that the rule 
> > ""Boundary condition ... should have derivatives of order 
> lower than 
> > the differential order of the partial differential equation" is 
> > applicable in this case.
> > 
> > End of my comments/ Ingolf
> 
> I'm pretty sure this is a real requirement. If you try 
> instead with lower order boundary conditions such as
> 
> \[Theta][0, t] ==
>          (-\[Lambda]s)*D[\[Theta][0, t], y], \[Theta][1, t] ==
>          (-\[Lambda]s)*D[\[Theta][1, t], y]
> 
> it will work fine (I realize this might not be what you want). 
> Alternatively I think you could do as Jens-Peer Kuska 
> suggested (integrate out the dependence on D[...,t]) and then 
> pick values for your integration constants.
> 
> Daniel Lichtblau
> Wolfram Research
> 




  • Prev by Date: Re: Eliminating intermediate results
  • Next by Date: efficiently adding many 2D Gaussians
  • Previous by thread: Re: RE: Re: Partial differential equation with
  • Next by thread: Re: Partial differential equation with evolving boundary conditions