Skip to main content
edited tags
Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160
Tweeted twitter.com/StackMma/status/988086913448988672
added 7 characters in body
Source Link

The grainy nature of the plot can be improved by choosing a smaller time step; say, stepSize=1stepSize = 1/20 or less. However, the current stepSize of 2 itself is quite slow (Timing reveals 0.344 seconds; AbsoluteTiming reveals 3.33 seconds).

I have a feeling that it is the nested nature of these functions (ParallelTable, UnitStep and Norm) that is taking a long time. IsIs there some way I can improve this? Currently, choosing a much smaller time step leads to an "out of memory" error (I have ~8 gigs~ 8 GB of memory that is exhausted!).

It is not Nest or Map that I am looking for, and if it is, I guess I am lost on its application in this case.

The grainy nature of the plot can be improved by choosing a smaller time step; say, stepSize=1/20 or less. However, the current stepSize of 2 itself is quite slow (Timing reveals 0.344 seconds; AbsoluteTiming reveals 3.33 seconds).

I have a feeling that it is the nested nature of these functions (ParallelTable, UnitStep and Norm) that is taking a long time. Is there some way I can improve this? Currently, choosing a much smaller time step leads to "out of memory" error (I have ~8 gigs of memory that is exhausted!).

It is not Nest or Map that I am looking for and if it, I guess I am lost on its application in this case.

The grainy nature of the plot can be improved by choosing a smaller time step; say, stepSize = 1/20 or less. However, the current stepSize of 2 itself is quite slow (Timing reveals 0.344 seconds; AbsoluteTiming reveals 3.33 seconds).

I have a feeling that it is the nested nature of these functions (ParallelTable, UnitStep and Norm) that is taking a long time. Is there some way I can improve this? Currently, choosing a much smaller time step leads to an "out of memory" error (I have ~ 8 GB of memory that is exhausted!).

It is not Nest or Map that I am looking for, and if it is, I guess I am lost on its application in this case.

deleted 52 characters in body; edited tags
Source Link

I am trying to use a recurrence plot to pin pointpinpoint the location when a system re-visits a previous point in its phase portrait. The system (a thin liquid film) is governed by a non-linear differential equation and is quite easily solved using NDSolve as shown:

{xMin, xMax} = {-(Piπ/0.0677), Piπ/0.0677}; 
k = 0.0677; 
TMax = 1650; 
m = 5; 
S = 100; 
Ga = -3^(-1); 
Quiet[uSolpbc = 
     u /. NDSolve[{D[u[t, x], 
        t] == (-S)*D[u[t, x]^3*D[u[t, x], x, x, x], x] + 
                 Ga*D[u[t, x]^3*D[u[t, x], x], x] - 
        m*D[(u[t, x]/(1 + u[t, x]))^2*
                       D[u[t, x], x], x], 
      u[0, x] == 1 - 0.01*Cos[k*x], u[t, xMin] == u[t, xMax],                  
      Derivative[0, 1]*u[t, xMin] == Derivative[0, 1]*u[t, xMax],                  
      Derivative[0, 2]*u[t, xMin] == Derivative[0, 2]*u[t, xMax],                  
      Derivative[0, 3]*u[t, xMin] == Derivative[0, 3]*u[t, xMax]}, 
     u, {t, 0, TMax}, {x, xMin, xMax}, MaxSteps -> 100000, 
     Method -> {"MethodOfLines", "Method" -> "LSODA", "TemporalVariable" -> t,"SpatialDiscretization" ->                      {"TensorProductGrid", "MinPoints" -> 800, "MaxPoints" -> 1200, 
                  "DifferenceOrder" -> 5}}][[1]]]

enter image description herefilm profile

Block[{stepSize = 2, end = TMax, tt, \[Tau]\[Tau]ττ, rd},
 rd = ParallelTable[
   UnitStep[
    0.01 - Norm[uSolpbc[tt, 0] - uSolpbc[\[Tau]\[Tau]uSolpbc[ττ, 0], 2]], {tt, 
    0, end, stepSize}, {\[Tau]\[Tau]ττ, 0, end, stepSize}];
 MatrixPlot[rd]]

enter image description hererecurrence plot, rough version

The grainy nature of the plot can be improved by choosing a smaller time step; say, stepSize=1/20stepSize=1/20 or less. However, the current stepSizestepSize of 2 itself is quite slow (Timing Revealsreveals 0.344 seconds; AbsoluteTiming reveals 3.33 seconds).

I have a feeling that it is the nested nature of these functions (ParallelTableParallelTable, UnitStepUnitStep and NormNorm) that is taking a long time. Is there some way I can improve this? Currently, choosing a much smaller time step leads to "out of memory" error (I have ~8 gigs of memory that is exhausted!).

It is not Nest or Map that I am looking for and if it, I guess I am lost on its application in this case.

Is

I am trying to use a recurrence plot to pin point the location when a system re-visits a previous point in its phase portrait. The system (a thin liquid film) is governed by a non-linear differential equation and is quite easily solved using NDSolve as shown:

{xMin, xMax} = {-(Pi/0.0677), Pi/0.0677}; 
k = 0.0677; 
TMax = 1650; 
m = 5; 
S = 100; 
Ga = -3^(-1); 
Quiet[uSolpbc = 
     u /. NDSolve[{D[u[t, x], 
        t] == (-S)*D[u[t, x]^3*D[u[t, x], x, x, x], x] + 
                 Ga*D[u[t, x]^3*D[u[t, x], x], x] - 
        m*D[(u[t, x]/(1 + u[t, x]))^2*
                       D[u[t, x], x], x], 
      u[0, x] == 1 - 0.01*Cos[k*x], u[t, xMin] == u[t, xMax],                  
      Derivative[0, 1]*u[t, xMin] == Derivative[0, 1]*u[t, xMax],                  
      Derivative[0, 2]*u[t, xMin] == Derivative[0, 2]*u[t, xMax],                  
      Derivative[0, 3]*u[t, xMin] == Derivative[0, 3]*u[t, xMax]}, 
     u, {t, 0, TMax}, {x, xMin, xMax}, MaxSteps -> 100000, 
     Method -> {"MethodOfLines", "Method" -> "LSODA", "TemporalVariable" -> t,"SpatialDiscretization" ->                      {"TensorProductGrid", "MinPoints" -> 800, "MaxPoints" -> 1200, 
                  "DifferenceOrder" -> 5}}][[1]]]

enter image description here

Block[{stepSize = 2, end = TMax, tt, \[Tau]\[Tau], rd},
 rd = ParallelTable[
   UnitStep[
    0.01 - Norm[uSolpbc[tt, 0] - uSolpbc[\[Tau]\[Tau], 0], 2]], {tt, 
    0, end, stepSize}, {\[Tau]\[Tau], 0, end, stepSize}];
 MatrixPlot[rd]]

enter image description here

The grainy nature of the plot can be improved by choosing a smaller time step; say, stepSize=1/20 or less. However, the current stepSize of 2 itself is quite slow (Timing Reveals 0.344 seconds; AbsoluteTiming reveals 3.33 seconds).

I have a feeling that it is the nested nature of these functions (ParallelTable, UnitStep and Norm) that is taking a long time. Is there some way I can improve this? Currently, choosing a much smaller time step leads to "out of memory" error (I have ~8 gigs of memory that is exhausted!).

It is not Nest or Map that I am looking for and if it, I guess I am lost on its application in this case.

Is

I am trying to use a recurrence plot to pinpoint the location when a system re-visits a previous point in its phase portrait. The system (a thin liquid film) is governed by a non-linear differential equation and is quite easily solved using NDSolve as shown:

{xMin, xMax} = {-(π/0.0677), π/0.0677}; 
k = 0.0677; 
TMax = 1650; 
m = 5; 
S = 100; 
Ga = -3^(-1); 
Quiet[uSolpbc = 
     u /. NDSolve[{D[u[t, x], 
        t] == (-S)*D[u[t, x]^3*D[u[t, x], x, x, x], x] + 
                 Ga*D[u[t, x]^3*D[u[t, x], x], x] - 
        m*D[(u[t, x]/(1 + u[t, x]))^2*
                       D[u[t, x], x], x], 
      u[0, x] == 1 - 0.01*Cos[k*x], u[t, xMin] == u[t, xMax],                  
      Derivative[0, 1]*u[t, xMin] == Derivative[0, 1]*u[t, xMax],                  
      Derivative[0, 2]*u[t, xMin] == Derivative[0, 2]*u[t, xMax],                  
      Derivative[0, 3]*u[t, xMin] == Derivative[0, 3]*u[t, xMax]}, 
     u, {t, 0, TMax}, {x, xMin, xMax}, MaxSteps -> 100000, 
     Method -> {"MethodOfLines", "Method" -> "LSODA", "TemporalVariable" -> t,"SpatialDiscretization" ->                      {"TensorProductGrid", "MinPoints" -> 800, "MaxPoints" -> 1200, 
                  "DifferenceOrder" -> 5}}][[1]]]

film profile

Block[{stepSize = 2, end = TMax, tt, ττ, rd},
 rd = ParallelTable[
   UnitStep[
    0.01 - Norm[uSolpbc[tt, 0] - uSolpbc[ττ, 0], 2]], {tt, 
    0, end, stepSize}, {ττ, 0, end, stepSize}];
 MatrixPlot[rd]]

recurrence plot, rough version

The grainy nature of the plot can be improved by choosing a smaller time step; say, stepSize=1/20 or less. However, the current stepSize of 2 itself is quite slow (Timing reveals 0.344 seconds; AbsoluteTiming reveals 3.33 seconds).

I have a feeling that it is the nested nature of these functions (ParallelTable, UnitStep and Norm) that is taking a long time. Is there some way I can improve this? Currently, choosing a much smaller time step leads to "out of memory" error (I have ~8 gigs of memory that is exhausted!).

It is not Nest or Map that I am looking for and if it, I guess I am lost on its application in this case.

edited tags
Link
Loading
deleted 17 characters in body
Source Link
dearN
  • 5.4k
  • 3
  • 35
  • 77
Loading
Source Link
dearN
  • 5.4k
  • 3
  • 35
  • 77
Loading