2 added 154 characters in body
source | link

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.

Is there anyway to get around this? Also using the same approach, I want to then use a square wave using the same approach.

Here is my 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] < 8.40749}, 
 {0, Abs[x] >= 8.40749}}]

interpolatingFunctLinear[f[x], -200, 200, 300]

Manipulate[ Show[Plot[
Evaluate[{Y[x, t] /. solnDerivativeY} /. t -> \[Tau]], {x, -200, 
200}, PlotRange -> {{-200, 200}, {0, 1.1}}]], {\[Tau], 0, 300}]

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. I
I want to know if I can resolve this IC issue. Thank You!!

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.

Is there anyway to get around this? Also using the same approach, I want to then use a square wave using the same approach.

Here is my 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] < 8.40749}, 
 {0, Abs[x] >= 8.40749}}]

interpolatingFunctLinear[f[x], -200, 200, 300]

Manipulate[ Show[Plot[
Evaluate[{Y[x, t] /. solnDerivativeY} /. t -> \[Tau]], {x, -200, 
200}, PlotRange -> {{-200, 200}, {0, 1.1}}]], {\[Tau], 0, 300}]

Mathematica evaluates this NDSolve indefinitely. I want to know if I can resolve this IC issue. Thank You!!

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.

Is there anyway to get around this? Also using the same approach, I want to then use a square wave using the same approach.

Here is my 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] < 8.40749}, 
 {0, Abs[x] >= 8.40749}}]

interpolatingFunctLinear[f[x], -200, 200, 300]

Manipulate[ Show[Plot[
Evaluate[{Y[x, t] /. solnDerivativeY} /. t -> \[Tau]], {x, -200, 
200}, PlotRange -> {{-200, 200}, {0, 1.1}}]], {\[Tau], 0, 300}]

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.
I want to know if I can resolve this IC issue. Thank You!!

1
source | link

NDSolve Wave Equation - Triangular Wave Pulse Inital Condition

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.

Is there anyway to get around this? Also using the same approach, I want to then use a square wave using the same approach.

Here is my 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] < 8.40749}, 
 {0, Abs[x] >= 8.40749}}]

interpolatingFunctLinear[f[x], -200, 200, 300]

Manipulate[ Show[Plot[
Evaluate[{Y[x, t] /. solnDerivativeY} /. t -> \[Tau]], {x, -200, 
200}, PlotRange -> {{-200, 200}, {0, 1.1}}]], {\[Tau], 0, 300}]

Mathematica evaluates this NDSolve indefinitely. I want to know if I can resolve this IC issue. Thank You!!