I am solving a system of three time-dependent partial differential equations on a circular domain, using the finite element method. However, in the outer part of the domain ($r>R$) the equations are different than in the inner part and the transition from the outer system of equations to the inner one has to be smooth.
To do this I defined the first set of equations ($EqUx1$, $EqUy1$, $EqT1$) and the second one ($EqUx2$, $EqUy2$, $EqT2$). And finally defined the actual system by multiplying the first set by the logistic sigmoid and the second one by $1-$ the logistic sigmoid:
dist[x_, y_] := (x^2 + y^2)^0.5; sig[x_, y_] := LogisticSigmoid[Slope*(dist[x, y] - Centre)]; EqUx = sig[x, y] * EqUx1 + (1 - sig[x, y]) * EqUx2; EqUx = sig[x, y] * EqUy1 + (1 - sig[x, y]) * EqUy2; EqT = sig[x, y] * EqT1 + (1 - sig[x, y]) * EqT2; Operator = {EqUx, EqUy, EqT}; bcs = DirichletCondition[{Ux[x, y, t] == 0., Uy[x, y, t] == 0., T[x, y, t] == Subscript[T, eq]}, True ]; ics = {Ux[x, y, 0] == 0, Uy[x, y, 0] == 0, T[x, y, 0] == Subscript[T, eq]}; pde = Operator == {0, 0, 0}; {Ux0, Uy0, T0} = NDSolveValue[{pde, bcs, ics}, {Ux, Uy, T}, {t, 0., Subscript[tt, last]}, {x, y} \[Element] mesh, DependentVariables -> {Ux, Uy, T}]; The sigmoid defined in the second line basically creates an inverted bump function in two dimensions (the Slope and Centre variables are used to manipulate the shape of the bump). The one dimensional equivalent would look like this:
sigR[r_] := LogisticSigmoid[Slope*(Abs[r] - Centre)]; This works nicely, however, I need a bump function that does not just converge to 1 and 0, but is exactly 0 before some radius value and exactly 1 after another. I have found some good examples (https://math.stackexchange.com/questions/101480/are-there-other-kinds-of-bump-functions-than-e-frac1x2-1), but they all produce errors while solving the equations numerically (finite element method) because Mathematica badly handles the points of transition to the exact value (0 or 1) even though they are infinitely differentiable (from the example in the link above).
So I am looking for a numerically-friendly bump function that has an exact value of 1 in the inner region and 0 in the outer region (so basically, a symmetrical smooth step function), can anyone help?
EDIT
These are the actual final equations that go into the solver (sorry for the greek letters):




sig[x,y]==1there are no derivatives left. Your interpolation therefore seems very singular. Try doing something similar in a simple example, say a simple ODE, may also fail. $\endgroup$(1 - Clip[(Abs[x] + h - 1)/(2 h), {0, 1}])^2 (1 + 2 Clip[(Abs[x] + h - 1)/(2 h), {0, 1}]), for a suitably tiny value ofh. $\endgroup$sigitself may not the problem here, but the interpolation you use. Your inner equations are not differential equations but boundary conditions. You seem to be using the interpolation as some ad-hoc way to implement boundary conditions, but the problem may be mathematically ill-posed this way. If you have more of science background, note that yourEqUx1and yourEqUx2have different units, and that should give you pause. $\endgroup$