I am attempting to solve a differential equation, however I am having issues implementing boundary conditions that reduce the impact of reflections/instabilities.
I've had a look at similar questions asked and how they've been answered - applying an absorbing potential, derivative boundary conditions, etc, but I've had no luck.
At the moment I'm applying Dirichlet at the edges of the domain, but I would rather have constant flux/absorbing boundaries to replicate an infinite domain and prevent negative and artificial values from being created.
You can see these in the contour plot.
Is there any way to apply such conditions to this code in particular and rid it of these artificial values?
L = 20;
LPlot = 10;
Time = 0.01;
h = 0.0001;
eqm = Derivative[1, 0, 0][f][t, x, y] - (1/10 (x - y) (Derivative[1, 1, 0][f][t, x, y] - Derivative[1, 0, 1][f][t, x, y]))
== 50 I*(Derivative[0, 2, 0][f][t, x, y] - Derivative[0, 0, 2][f][t, x, y])
- I*(x - y) (Derivative[0, 1, 0][f][t, x, y] - Derivative[0, 0, 1][f][t, x, y])
- 5*(x - y)^2 f[t, x, y]
+ 1/10*((-1)*(5*(Derivative[0, 2, 0][f][t, x, y] - Derivative[0, 0, 2][f][t, x, y])
+ 5*(x - y) (Derivative[0, 1, 0][f][t, x, y] - Derivative[0, 0, 1][f][t, x, y])
+ 5*(x - y)^2 f[t, x, y])
+ (5*(x - y)^3 (Derivative[0, 1, 0][f][t, x, y] - Derivative[0, 0, 1][f][t, x, y])
+ 5*(x - y)^2 (Derivative[0, 2, 0][f][t, x, y] - 2*Derivative[0, 1, 1][f][t, x, y] + Derivative[0, 0, 2][f][t, x, y])
+ 10 I*(x - y) (Derivative[0, 1, 0][f][t, x, y] + Derivative[0, 0, 1][f][t, x, y])));
ic = f[0, x, y] == (Exp[-((x + 5)^2 + (y + 5)^2)] + Exp[-((x - 5)^2 + (y - 5)^2)]) + (Exp[-((x + 5)^2 + (y - 5)^2)] + Exp[-((x - 5)^2 + (y + 5)^2)]);
sol = Evaluate[NDSolveValue[{
eqm,
ic,
DirichletCondition[f[t, x, y] == 0, {x == L, y == L, x == -L, y == -L}]},
f, {t, -0.001, Time}, {x, -L, L}, {y, -L, L}, MaxStepSize -> h,
AccuracyGoal -> 5, PrecisionGoal -> 5,
Method -> {"MethodOfLines", "TemporalVariable" -> t,
"SpatialDiscretization" -> {"FiniteElement"}}]];
Manipulate[Plot[Re[sol[t, x, -x]], {x, -LPlot, LPlot}, PlotRange -> {-0.5, 1}], {{t, Time}, 0, Time, Appearance -> "Labeled"(*,Animator*)}]
Manipulate[ContourPlot[Re[sol[t, x, y]], {x, -LPlot, LPlot}, {y, -LPlot, LPlot}, Contours -> 20, ColorFunction -> "TemperatureMap", PlotLegends -> Automatic, PlotRange -> All], {{t, Time}, 0, Time, Appearance -> "Labeled"(*,Animator*)}]
DirichletConditon
. Also the optionsMaxStepSize\[Rule]h,AccuracyGoal\[Rule]5,PrecisionGoal\[Rule]5
toNDSolve
are not really needed. You can check for min max values withMinMax /@ Through[{Re, Im}[sol["ValuesOnGrid"]]]
If you remove the DirichletBC and the FEM option you get other messages maybe those lead you in the right direction. $\endgroup$