Skip to main content
Off[NDSolve::mxsst];
L = 4*\[Pi];4*π;
c = -(1/20);
tmax = 1000;
ini1 = Interpolation@Flatten[Table[{{x, y}, 1 + c*RandomReal[{-1, 1}]}, {x, 0, L + 1}, {y, 0, L + 1}], 1]; (*initial condition given by acl*)
cond3D = First[h /. NDSolve[{D[h[x, y, t], t] + 
Div[h[x, y, t]^3*Grad[Laplacian[h[x, y, t], {x, y}], {x, y}], {x, y}] + 
Div[h[x, y, t]^3*Grad[h[x, y, t], {x, y}], {x, y}] == 0,
h[0, y, t] == h[L, y, t],
h[x, 0, t] == h[x, L, t],
h[x, y, 0] == ini1[x, y]
 },
h, {x, 0, L}, {y, 0, L}, {t, 0, tmax},
Method -> {"BDF", "MaxDifferenceOrder" -> 1}, 
MaxStepFraction -> 1/50]]
Off[NDSolve::mxsst];
L = 4*\[Pi];
c = -(1/20);
tmax = 1000;
ini1 = Interpolation@Flatten[Table[{{x, y}, 1 + c*RandomReal[{-1, 1}]}, {x, 0, L + 1}, {y, 0, L + 1}], 1]; (*initial condition given by acl*)
cond3D = First[h /. NDSolve[{D[h[x, y, t], t] + 
Div[h[x, y, t]^3*Grad[Laplacian[h[x, y, t], {x, y}], {x, y}], {x, y}] + 
Div[h[x, y, t]^3*Grad[h[x, y, t], {x, y}], {x, y}] == 0,
h[0, y, t] == h[L, y, t],
h[x, 0, t] == h[x, L, t],
h[x, y, 0] == ini1[x, y]
 },
h, {x, 0, L}, {y, 0, L}, {t, 0, tmax},
Method -> {"BDF", "MaxDifferenceOrder" -> 1}, 
MaxStepFraction -> 1/50]]
Off[NDSolve::mxsst];
L = 4*π;
c = -(1/20);
tmax = 1000;
ini1 = Interpolation@Flatten[Table[{{x, y}, 1 + c*RandomReal[{-1, 1}]}, {x, 0, L + 1}, {y, 0, L + 1}], 1]; (*initial condition given by acl*)
cond3D = First[h /. NDSolve[{D[h[x, y, t], t] + 
Div[h[x, y, t]^3*Grad[Laplacian[h[x, y, t], {x, y}], {x, y}], {x, y}] + 
Div[h[x, y, t]^3*Grad[h[x, y, t], {x, y}], {x, y}] == 0,
h[0, y, t] == h[L, y, t],
h[x, 0, t] == h[x, L, t],
h[x, y, 0] == ini1[x, y]
 },
h, {x, 0, L}, {y, 0, L}, {t, 0, tmax},
Method -> {"BDF", "MaxDifferenceOrder" -> 1}, 
MaxStepFraction -> 1/50]]
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in NDSolve. In other word, rand(x,y) is a special pseudo-random function distributed in the interval (-1,1) which has periodicity between the sides of the square-domain [0,L]*[0,L], that is, rand(0,y)=rand(L,y) and rand(x,0)=rand(x,L). In fact, this question is very similar to this questionthis question.

Based on acl's commentacl's comment and Vitaliy's answerVitaliy's answer, I have the following working example with two different initial conditions.

If I use the other initial condition given by @Vitaliy@Vitaliy just with a slight modification:

I realized that Vitaliy's answerVitaliy's answer is wonderful in SplineClosed -> True that makes I can use it with periodic boundary conditions in NDSolve. But another confused issue is when I try, ini2[9, 0] === ini2[9, L] // FullSimplify using my ini2, MMA gives False.I know @Vitaliy produced a disturbed surface in the domain[0, 1]* [0, 1], but how to get such a surface in a square domain, [0, L]*[0, L].

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in NDSolve. In other word, rand(x,y) is a special pseudo-random function distributed in the interval (-1,1) which has periodicity between the sides of the square-domain [0,L]*[0,L], that is, rand(0,y)=rand(L,y) and rand(x,0)=rand(x,L). In fact, this question is very similar to this question.

Based on acl's comment and Vitaliy's answer, I have the following working example with two different initial conditions.

If I use the other initial condition given by @Vitaliy just with a slight modification:

I realized that Vitaliy's answer is wonderful in SplineClosed -> True that makes I can use it with periodic boundary conditions in NDSolve. But another confused issue is when I try, ini2[9, 0] === ini2[9, L] // FullSimplify using my ini2, MMA gives False.I know @Vitaliy produced a disturbed surface in the domain[0, 1]* [0, 1], but how to get such a surface in a square domain, [0, L]*[0, L].

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in NDSolve. In other word, rand(x,y) is a special pseudo-random function distributed in the interval (-1,1) which has periodicity between the sides of the square-domain [0,L]*[0,L], that is, rand(0,y)=rand(L,y) and rand(x,0)=rand(x,L). In fact, this question is very similar to this question.

Based on acl's comment and Vitaliy's answer, I have the following working example with two different initial conditions.

If I use the other initial condition given by @Vitaliy just with a slight modification:

I realized that Vitaliy's answer is wonderful in SplineClosed -> True that makes I can use it with periodic boundary conditions in NDSolve. But another confused issue is when I try, ini2[9, 0] === ini2[9, L] // FullSimplify using my ini2, MMA gives False.I know @Vitaliy produced a disturbed surface in the domain[0, 1]* [0, 1], but how to get such a surface in a square domain, [0, L]*[0, L].

added 5 characters in body
Source Link
Enter
  • 1.3k
  • 12
  • 23

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in NDSolve. In other word, rand(x,y) is a special pseudo-random function distributed in the interval (-1,1) which has periodicity atbetween the sides of the square-domain [0,L]*[0,L], that is, rand(0,y)=rand(L,y) and rand(x,0)=rand(x,L). In fact, this question is very similar to this question.

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in NDSolve. In other word, rand(x,y) is a special pseudo-random function distributed in the interval (-1,1) which has periodicity at the sides of the square-domain [0,L]*[0,L], that is, rand(0,y)=rand(L,y) and rand(x,0)=rand(x,L). In fact, this question is very similar to this question.

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in NDSolve. In other word, rand(x,y) is a special pseudo-random function distributed in the interval (-1,1) which has periodicity between the sides of the square-domain [0,L]*[0,L], that is, rand(0,y)=rand(L,y) and rand(x,0)=rand(x,L). In fact, this question is very similar to this question.

deleted 229 characters in body
Source Link
Enter
  • 1.3k
  • 12
  • 23
Loading
added 8 characters in body
Source Link
Enter
  • 1.3k
  • 12
  • 23
Loading
Source Link
Enter
  • 1.3k
  • 12
  • 23
Loading