Re: Imposing boundary condition at infinity

*To*: mathgroup at smc.vnet.net*Subject*: [mg102561] Re: Imposing boundary condition at infinity*From*: Harutyun <amirjanyan at gmail.com>*Date*: Fri, 14 Aug 2009 05:58:25 -0400 (EDT)*References*: <h60es7$pjh$1@smc.vnet.net>

you can solve this almost analytically DSolve[D[u[x, t], t] == -(1 + u[x, t])*D[u[x, t], x], u, {x, t}] returns Solve[C[1][u[x, t], (t - x + t u[x, t])/(1 + u[x, t])] == 0, u[x, t]] which is equivalent to Solve[u[x, t] = C[3][t - x + t u[x, t]] == 0, u[x, t]] which is easier to solve numerically (here u[x, 0] = C[3][ - x] == 0) one way for numerical solving is startFun[x_] = Exp[-x^2] u1 = Function[{x, t}, z /. FindRoot[z == startFun[x - t z - t], {z, startFun[x]}]] Plot[u1[x, 1], {x, -3, 7}] for bigger t-s solution develops singularity Plot[u1[x, 1.3], {x, -3, 7}] this agrees with solution by NDSolve ini = 6; sol = NDSolve[{D[u[x, t], t] == -(1 + u[x, t])*D[u[x, t], x], u[-ini, t] == u[ini, t] == 0, u[x, 0] == Exp[-x^2]}, u, {x, -ini, ini}, {t, 0, 1}, MaxSteps -> Infinity] Plot3D[u[x, t] /. sol, {x, -ini, ini}, {t, 0, 1}]