My question is related to this former question (1D transient heat equation problem with controller), which has already been solved, but the issue is now a different one.
In the already solved question, the controller was acting globally on the bar, compensating perturbations occurring at the left boundary x=0.
Now I would like to implement a controller acting at the left boundary x=0, in order to compensate global perturbations on the bar, so that the temperature at the right boundary x=10 stays constant around 25.
$u(t,x)$ obeys to following PDE on a x-line from 0 to 10:
$u^{(0,1)}(x,t)=u^{(2,0)}(x,t)+ \operatorname{perturbations}(t)$,
with:
$\operatorname{perturbations}(t)=0,1 \sin \left(\frac{t}{50}\right)$
and
Initial condition: $u(0,x)=25$
Boundary conditions: $u(t,0)=25-Kp*(u(t, 10) - 25)$ and $u^{(0,1)}(t,10)=0$
Here is the code I have tried in Mathematica 11. Just replace 0 by 1 before Kp to activate the controller and get the error, which is now:
NDSolveValue::bcedge: Boundary condition u[t,0]==25-2 (-25+u[t,10]) is not specified on a single edge of the boundary of the computational domain.
Kp = 2;
sol = NDSolveValue[{D[u[t, x], t] == 0.5*D[u[t, x], x, x] + 0.1*Sin[t/50],
u[0, x] == 25,
u[t, 0] == 25 - 0*Kp ((u[t, x] /. x -> 10) - 25),
(D[u[t, x], x] /. x -> 10) == 0},
u, {t, 0, 1000}, {x, 0, 10}]
{Plot3D[sol[t, x], {t, 0, 1000}, {x, 0, 10}, PlotRange -> All, AxesLabel -> {"Time", "x"},
PlotLegends -> {"usol(t,x)"},PlotTheme -> "Detailed", ImageSize -> 300],
Plot[Evaluate[sol[t, x] /. x -> {0, 10}, {t, 0, 1000}],ImageSize -> 300,
PlotLegends ->Table[Style[StringJoin["x=", ToString[i]], FontSize -> 12,
FontFamily -> "Cambria Math"], {i, {0, 10}}],
PlotStyle -> Table[RGBColor[0.1, j, 0.5], {j, 0, 1, 1/2}],
PlotTheme -> "Detailed", PlotRange -> All,
FrameLabel -> {Style["Time", 12, FontFamily -> "Cambria Math"]}]}