NDSolve Wave Equation - Triangular Wave Pulse Inital Condition - Mathematica Stack Exchange most recent 30 from mathematica.stackexchange.com 2019-10-19T19:13:56Z https://mathematica.stackexchange.com/feeds/question/60386 https://creativecommons.org/licenses/by-sa/4.0/rdf https://mathematica.stackexchange.com/q/60386 1 NDSolve Wave Equation - Triangular Wave Pulse Inital Condition soccerboyz9341 https://mathematica.stackexchange.com/users/19449 2014-09-22T14:37:37Z 2014-09-22T14:51:03Z <p>I am trying to solve a simple damped wave equation with transparent boundary conditions with triangular shaped piecewise function as my initial condition. I understand that there are issues with this initial condition because it is not differentiable at the center and at the two vertices of the triangular wave pulse. </p> <p>Is there anyway to get around this? Also using the same approach, I want to then use a square wave using the same approach.</p> <p>Here is my code:</p> <pre><code>interpolatingFunctLinear[initalPulseFunction_, xBoundLow_, xBoundHigh_, timeBound_] := First[ pdeY = D[Y[x, t], t, t] + .04 D[Y[x, t], t] == D[Y[x, t], x, x]; solnDerivativeY = NDSolve[{pdeY, Y[x, 0] == initalPulseFunction, Derivative[0, 1][Y][x, 0] == 0, Derivative[1, 0][Y][xBoundLow, t] == Derivative[0, 1][Y][xBoundLow, t], Derivative[1, 0][Y][xBoundHigh, t] == -Derivative[0, 1][Y][xBoundHigh, t]}, Y, {x, xBoundLow, xBoundHigh}, {t, 0, timeBound }]] f[x_] := Piecewise[{{1 - 0.118941 Abs[x] , Abs[x] &lt; 8.40749}, {0, Abs[x] &gt;= 8.40749}}] interpolatingFunctLinear[f[x], -200, 200, 300] Manipulate[ Show[Plot[ Evaluate[{Y[x, t] /. solnDerivativeY} /. t -&gt; \[Tau]], {x, -200, 200}, PlotRange -&gt; {{-200, 200}, {0, 1.1}}]], {\[Tau], 0, 300}] </code></pre> <p>Mathematica evaluates this NDSolve indefinitely, and gets "NDSolve::mxsst: Using maximum number of grid points 10000 allowed by the MaxPoints or MinStepSize options for independent variable x" error.<br> I want to know if I can resolve this IC issue. Thank You!!</p>