Re: initial condition in using dsolve

• To: mathgroup at smc.vnet.net
• Subject: [mg64394] Re: [mg64316] initial condition in using dsolve
• Date: Wed, 15 Feb 2006 03:32:13 -0500 (EST)
• References: <200602110832.DAA18297@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```On Sat, 11 Feb 2006, rudy wrote:

> Hello,
> I'm trying to use DSolve tu obtaine the solution of the PDE:
> eq={D[f[x, t], t]+ v*D[f[x, t], x]==0, f[x, 0]==fo[x]}
>
> but with the instruction
>
> DSolve[eq, f, {x, t}]
>
> Mathematica doesn't resolve.
> It's strange because the solution is known:
>
> f[x,t] = f[x- v t,0]
>
> If I do:
>
> eq={D[f[x, t], t]+ v*D[f[x, t], x]==0}
> and
> DSolve[eq, f, {x, t}]
> it works:
>
> out > {f -> Function[{x, t}, C[1][(t v - x)/v]]}
>
> I don't understand why it works in the second case and not in the first...
> can anybody help?
> Regards
> Rudy
>
Hello Rudy,

At present, the DSolve function can find the general solution for
a linear first-order partial differential equation such as the one
considered by you. However, it is currently not possible to solve
initial-value problems for such equations. For this reason, In[3]
below returns unevaluated while In[5] returns a result.

==============================================

In[1]:= \$Version

Out[1]= 5.2 for Linux (June 27, 2005)

In[2]:=  eq = {D[f[x, t], t] + v*D[f[x, t], x] == 0, f[x, 0] == fo[x]};

In[3]:= DSolve[eq, f, {x, t}]//InputForm

Out[3]//InputForm=
DSolve[{Derivative[0, 1][f][x, t] + v*Derivative[1, 0][f][x, t] == 0,
f[x, 0] == fo[x]}, f, {x, t}]

In[4]:=  eq = {D[f[x, t], t] + v*D[f[x, t], x] == 0};

In[5]:= (sol = DSolve[eq, f, {x, t}]) // InputForm

Out[5]//InputForm= {{f -> Function[{x, t}, C[1][(t*v - x)/v]]}}

===============================================

We hope to include the functionality for solving initial-value
problems for PDEs in a future release.

an expression for the solution f[x, t] of the initial-value
problem as follows.

=============================================

In[6]:= f0[x] == (f[x, t]/.sol[[1]]/.{t-> 0})

x
Out[6]= f0[x] == C[1][-(-)]
v

In[7]:= f[x_, t_] = (f[x, t] /. sol[[1]] /. {C[1][a_] :> f0[-v*a]})

Out[7]= f0[-(t v) + x]

=============================================

We can now verify that this solution satisfies the equation and
the initial condition.

==========================================

In[8]:= f[x, 0]

Out[8]= f0[x]

In[9]:= D[f[x, t], t] + v*D[f[x, t], x]

Out[9]= 0

=======================================

Sorry for the inconvenience caused by this limitation.

Sincerely,

Wolfram Research

```

• Prev by Date: Re: Using a text editor like interface for Mathematica?
• Next by Date: Re: Joining List of Lists
• Previous by thread: initial condition in using dsolve
• Next by thread: newbie want to join the group