i have been struggling to compute a particular instance of cylindrical 3D heat equation.
(*parameter*)
\[Alpha] = 0.1;
h = 1;
eq = D[u[t, r, \[Theta], z], t] -
D[u[t, r, \[Theta], z], r, r] + (1/r) D[u[t, r, \[Theta], z], r] +
1/(\[Alpha]^2 r^2) D[u[t, r, \[Theta], z], \[Theta], \[Theta]] +
D[u[t, r, \[Theta], z], z, z];
(*initial and boundary conditions*)
ic = {u[0, r, \[Theta], z] == Exp[-r]};
bc = {u[t, 10^-6, \[Theta], z] == 1, u[t, 1, \[Theta], z] == 0,
PeriodicBoundaryCondition[u[t, r, \[Theta], z], \[Theta] == 0,
TranslationTransform[{0, 2*Pi*\[Alpha], 0}]],
PeriodicBoundaryCondition[u[t, r, \[Theta], z], z == 0,
TranslationTransform[{0, 0, h}]]};
(*solution*)
sol = NDSolve[{eq ==
NeumannValue[0, r == 10^-6] + NeumannValue[1, r == 1], ic, bc},
u[t, r, \[Theta], z], {t, 0, 10}, {r, 10^-6, 1}, {\[Theta], 0,
2*Pi}, {z, 0, h}];
(*plot*)
Manipulate[
Plot3D[sol, {r, 0, 1}, {\[Theta], 0, 2 Pi}], {t, 0, 10}, {z, 0, 1}];
I have corrected the error regarding the definition of eq. I also corrected the error regarding my periodic boundary conditions. I previously made a mistake
The period regarding the \[Theta] variable should have been 2*Pi*\[Alpha] instead of just 2*Pi.
And the period regarding the z variable would just be the height of my cylinder which i called h.
edit : So it seems that the solution would be to apply TranslationTransform to only the 3 variables of space and not the time space vector. It gets rid of the mapping error but now I must face another one
NDSolve::femnodpbc: DirichletCondition can not be present on the target boundary of a PeriodicBoundaryConditon.
It appears that I must examine where the case where both the pbc and regular boundary conditions are both conflicting.

1/\[Alpha]\.b2r\.b2does not have a value defined. Something is odd with your typesetting. Try:1/(\[Alpha]^2 r^2)– user21 Jun 01 '20 at 10:56Derivative[0, 1, 0, 0][u][t, 1, \[Theta], z]is not going to wok. UseNeumannValuefor that. Or, alternatively, get rid of thePeriodicBoundaryConditonand make use of theu[t, r, 0, z]==u[t, r, 2 Pi, z]syntax. The also replace the second PBC in the same manner. – user21 Jun 01 '20 at 11:00NeumannValue[Derivative...]? – user21 Jun 01 '20 at 11:42D[u[t, r, \[Theta], z], z, \[Theta]]in the equation. Unfortunately i wish i could tell you more but i have been asked not to reveal any more than the simplified equation. I apologize for not being able to tell you more. – ConfuzzledStudent Jun 01 '20 at 16:48u[t, r, \[Theta], 0] == u[t, r, \[Theta], 2 Pi*\[Alpha]]whereas the second one is for the variable theta :
u[t, r, 0, z] == u[t, r, 2 Pi, z].There should only be two periodic boundary conditions. Did i perhaps make a third one ?
– ConfuzzledStudent Jun 01 '20 at 19:42molin that way? You're making almost the same mistake in every edit. In short: If you want to useFiniteElementmethod, then you cannot haveDerivativein your b.c.s, you need to re-express them withNeumannValue. Please calm down, read the answers you found carefully, and stop coding blindly. – xzczd Jun 02 '20 at 10:22u[t, r, 0, z]==u[t, r, 2 Pi, z]instead, as user21 pointed.But when i did, i encountered the error
– ConfuzzledStudent Jun 02 '20 at 11:11NDSolve::fembcdepderiv: Derivatives of dependent variables in boundary conditions are not supported with the Finite Element Method in this version of NDSolve..which i have no idea how to solve.NeumannValueisn't like that. Please check the document of it carefully by pressing F1. "Truth be told i do not really know what it does. " Then as asked above, why do you modify themolfunction that way? I've never defined amolfunction involvingFiniteElement. Do noticemolis a helper function for theTensorProduceGridmethod. – xzczd Jun 02 '20 at 11:25NeumannValue[Derivative...]is just wrong. – xzczd Jun 02 '20 at 11:45TranslationTransformis used correctly ?Otherwise i'm dealing with a very peculiar issue right now (see edit) but i'll try to understand the answer i found first.
– ConfuzzledStudent Jun 02 '20 at 12:11Derivative[0, 1, 0, 0][u][t, 1, θ, z] == 1, then theNeumannValueis still incorrect. 2. You're setting bothPeriodicBoundaryConditioninθdirection, which is undoubted wrong. Once again, please calm down, and check carefully.Now that the pbc error is fixed, it leaves us with the NeumannValue. Would this change work correctly ? My bc was indeed
Derivative[0, 1, 0, 0][u][t, 1, θ, z] == 1here is the edit :
– ConfuzzledStudent Jun 02 '20 at 13:00sol = NDSolve[{eq == NeumannValue[0, r == 10^-6] + NeumannValue[1, r == 1], ic, bc}, u[t, r, \[Theta], z], {t, 0, 10}, {r, 10^-6, 1}, {\[Theta], 0, 2*Pi}, {z, 0, 1}];eq? 2. The question has become rather messy now, please consider removing some of the unsuccessful trial to keep it clean. 3.It's better to show us the problem in traditional math notation so we can check easier.eqyou've already added==, so you've now writen down an equation in the form(… = …) = NeumannValue[…], which is clearly wrong. If you still don't understand what I mean, then once again, please check the document ofNeumannValueand see what's the correct way to add it to the equation. – xzczd Jun 03 '20 at 01:45ic = {u[0, r, \[Theta], z] == Exp[-r]}; bc = {u[t, 10^-6, \[Theta], z] == 1, u[t, 1, \[Theta], z] == 0, u[t, r, 0, z] == u[t, r, 2 Pi, z], u[t, r, \[Theta], 0] == u[t, r, \[Theta], 2*Pi], Derivative[0, 1, 0, 0][u][t, 10^-6, \[Theta], z] == 0, Derivative[0, 1, 0, 0][u][t, 1, \[Theta], z] == 1 }; sol = NDSolve[{eq == 0, ic, bc}, u[t, r, \[Theta], z], {t, 0, 10}, {r, 10^-6, 1}, {\[Theta], 0, 2*Pi}, {z, 0, 1}];– user21 Jun 03 '20 at 05:58\[Alpha]. – ConfuzzledStudent Jun 03 '20 at 13:42I guess i should look at how to use the TPG method then.
– ConfuzzledStudent Jun 03 '20 at 13:48zboundary condition. You specify it to be periodic, but with no value specified atz=0orz=hso it could be anything. – Bill Watts Jun 03 '20 at 23:15NDSolveif you leave $\theta$ in your pde with no pertinent bc's so that term should be removed. If your more complicated equation requires $\theta$ dependence and you want to include it in this problem then you should specify some $\theta$ dependence in either your initial condition or at yourr = 1boundary. – Bill Watts Jun 04 '20 at 00:30PeriodicBoundaryConditiondoesn't behave like this, for more info see the discussion in this post. Currently the simplest way to get the traditional periodic b.c. (in regular domain of course) is to use the old goodTensorProductGrid. Then, 5th b.c. looks strange, why is the period $2\pi \alpha$? – xzczd Jun 04 '20 at 02:58