Skip to main content
edited tags
Link
xzczd
  • 71.6k
  • 10
  • 183
  • 524
added 66 characters in body; edited tags
Source Link
xzczd
  • 71.6k
  • 10
  • 183
  • 524

Backslide introduced in 9, persisting through 13.


I am trying to solve the KdV equation numerically. The following code would work perfectly in version 5:

q[x_] = (Erf[x] - 1)/2 - 5 Sech[x - 1]; xmax = 300; tmax = 10; NDSolve[{D[u[x, t], t] == -D[u[x, t], x, x, x] + 6 u[x, t] D[u[x, t], x], u[x,0] == q[x], u[-xmax, t] == -1, u[xmax, t] == 0, Derivative[1, 0][u][-xmax, t] == 0, Derivative[1, 0][u][xmax, t] == 0}, u, {t, 0, tmax}, {x, -xmax, xmax}, Method -> StiffnessSwitching] 

but fails in 12.3.0 for Mac with the error:

At t==1.57.., stepsize is effectively zero

Obviously the method used by Mathematica produces oscillations on the positive half-axis, which should not be there. Any hints on how to get a valid numerical solution with Mathematica? Thanks.

I am trying to solve the KdV equation numerically. The following code would work perfectly in version 5:

q[x_] = (Erf[x] - 1)/2 - 5 Sech[x - 1]; xmax = 300; tmax = 10; NDSolve[{D[u[x, t], t] == -D[u[x, t], x, x, x] + 6 u[x, t] D[u[x, t], x], u[x,0] == q[x], u[-xmax, t] == -1, u[xmax, t] == 0, Derivative[1, 0][u][-xmax, t] == 0, Derivative[1, 0][u][xmax, t] == 0}, u, {t, 0, tmax}, {x, -xmax, xmax}, Method -> StiffnessSwitching] 

but fails in 12.3.0 for Mac with the error:

At t==1.57.., stepsize is effectively zero

Obviously the method used by Mathematica produces oscillations on the positive half-axis, which should not be there. Any hints on how to get a valid numerical solution with Mathematica? Thanks.

Backslide introduced in 9, persisting through 13.


I am trying to solve the KdV equation numerically. The following code would work perfectly in version 5:

q[x_] = (Erf[x] - 1)/2 - 5 Sech[x - 1]; xmax = 300; tmax = 10; NDSolve[{D[u[x, t], t] == -D[u[x, t], x, x, x] + 6 u[x, t] D[u[x, t], x], u[x,0] == q[x], u[-xmax, t] == -1, u[xmax, t] == 0, Derivative[1, 0][u][-xmax, t] == 0, Derivative[1, 0][u][xmax, t] == 0}, u, {t, 0, tmax}, {x, -xmax, xmax}, Method -> StiffnessSwitching] 

but fails in 12.3.0 for Mac with the error:

At t==1.57.., stepsize is effectively zero

Obviously the method used by Mathematica produces oscillations on the positive half-axis, which should not be there. Any hints on how to get a valid numerical solution with Mathematica? Thanks.

added 2 characters in body
Source Link
xzczd
  • 71.6k
  • 10
  • 183
  • 524

I am trying to solve the KdV equation numerically. The following code would work perfectly in version 5:

q[x_] = (Erf[x] - 1)/2 - 5 Sech[x - 1]; xmax = 300; tmax = 10;

NDSolve[{D[u[x, t], t] == -D[u[x, t], x, x, x] + 6 u[x, t] D[u[x, t], x], u[x,0] == q[x], u[-xmax, t] == -1, u[xmax, t] == 0, Derivative[1, 0][u][-xmax, t] == 0, Derivative[1, 0][u][xmax, t] == 0}, u, {t, 0, tmax}, {x, -xmax, xmax}, Method -> StiffnessSwitching]

q[x_] = (Erf[x] - 1)/2 - 5 Sech[x - 1]; xmax = 300; tmax = 10; NDSolve[{D[u[x, t], t] == -D[u[x, t], x, x, x] + 6 u[x, t] D[u[x, t], x], u[x,0] == q[x], u[-xmax, t] == -1, u[xmax, t] == 0, Derivative[1, 0][u][-xmax, t] == 0, Derivative[1, 0][u][xmax, t] == 0}, u, {t, 0, tmax}, {x, -xmax, xmax}, Method -> StiffnessSwitching] 

but fails in 12.3.0 for Mac with the error:

At t==1.57.., stepsize is effectively zero;

At t==1.57.., stepsize is effectively zero

Obviously the method used by MathematicaMathematica produces oscillations on the positive half-axis, which should not be there. Any hints on how to get a valid numerical solution with MathematicaMathematica? Thanks.

I am trying to solve the KdV equation numerically. The following code would work perfectly in version 5:

q[x_] = (Erf[x] - 1)/2 - 5 Sech[x - 1]; xmax = 300; tmax = 10;

NDSolve[{D[u[x, t], t] == -D[u[x, t], x, x, x] + 6 u[x, t] D[u[x, t], x], u[x,0] == q[x], u[-xmax, t] == -1, u[xmax, t] == 0, Derivative[1, 0][u][-xmax, t] == 0, Derivative[1, 0][u][xmax, t] == 0}, u, {t, 0, tmax}, {x, -xmax, xmax}, Method -> StiffnessSwitching]

but fails in 12.3.0 for Mac with the error:

At t==1.57.., stepsize is effectively zero;

Obviously the method used by Mathematica produces oscillations on the positive half-axis, which should not be there. Any hints on how to get a valid numerical solution with Mathematica? Thanks.

I am trying to solve the KdV equation numerically. The following code would work perfectly in version 5:

q[x_] = (Erf[x] - 1)/2 - 5 Sech[x - 1]; xmax = 300; tmax = 10; NDSolve[{D[u[x, t], t] == -D[u[x, t], x, x, x] + 6 u[x, t] D[u[x, t], x], u[x,0] == q[x], u[-xmax, t] == -1, u[xmax, t] == 0, Derivative[1, 0][u][-xmax, t] == 0, Derivative[1, 0][u][xmax, t] == 0}, u, {t, 0, tmax}, {x, -xmax, xmax}, Method -> StiffnessSwitching] 

but fails in 12.3.0 for Mac with the error:

At t==1.57.., stepsize is effectively zero

Obviously the method used by Mathematica produces oscillations on the positive half-axis, which should not be there. Any hints on how to get a valid numerical solution with Mathematica? Thanks.

Became Hot Network Question
Tweeted twitter.com/StackMma/status/1482412274396672000
Source Link
gerald
  • 243
  • 1
  • 6
Loading