I've been using the following syntax to set boundary condition which is a derivative, when passing it to pdsolve. Say we want to set u(r,theta,t) to have insulated boundary conditions at r=1. So the BC will be
For example, to set derivative of u w.r.t. "r" to zero when r=1
eval( diff(u(r,theta,t),r), r=1) = 0; #(1)
or using this syntax
D[1](u)(1, theta, t) = 0; #(2)
But now I find, on one example below, that the above no longer works. I have to use this syntax (which I did not know about) for it to work
D[1]*u(1, theta, t) = 0; #(3)
Has something changed? why when using (3) pdsolve now gives result, but when using (2) or (1) it returns unevaluated? are the three semantically equivalent? when to use which syntax?
I am using Physics updates 265, Latest Maple 2018.2
Here is an example showing the (1,2) syntax no longer works, but the (3) syntax works
#articolo example 6.9.2
restart;
#using (1) syntax
pde := diff(u(r, theta, t), t) = (diff(u(r, theta, t), r)+r*(diff(u(r, theta, t), r, r))+(diff(u(r, theta, t), theta, theta))/r)/(25*r);
bc_on_r := eval(diff(u(r,theta,t),r), r=1) = 0;
bc_on_theta:= u(r,0,t)=0, u(r,Pi,t)=0;
ic := u(r,theta,0)=(r-1/3*r^3)*sin(theta);
pdsolve([pde, bc_on_r,bc_on_theta,ic], u(r, theta, t), HINT = boundedseries(r = [0]))
does not solve it.
restart;
#using (2) syntax
pde := diff(u(r, theta, t), t) = (diff(u(r, theta, t), r)+r*(diff(u(r, theta, t), r, r))+(diff(u(r, theta, t), theta, theta))/r)/(25*r);
bc_on_r := D[1](u)(1, theta, t) = 0;
bc_on_theta:= u(r,0,t)=0, u(r,Pi,t)=0;
ic := u(r,theta,0)=(r-1/3*r^3)*sin(theta);
pdsolve([pde, bc_on_r,bc_on_theta,ic], u(r, theta, t), HINT = boundedseries(r = [0]))
does not solve it.
restart;
#using(3) syntax
pde := diff(u(r, theta, t), t) = (diff(u(r, theta, t), r)+r*(diff(u(r, theta, t), r, r))+(diff(u(r, theta, t), theta, theta))/r)/(25*r);
bc_on_r := D[1]*u(1,theta,t)=0;
bc_on_theta:= u(r,0,t)=0, u(r,Pi,t)=0;
ic := u(r,theta,0)=(r-1/3*r^3)*sin(theta);
pdsolve([pde, bc_on_r,bc_on_theta,ic], u(r, theta, t), HINT = boundedseries(r = [0]))
![]()
I've used syntax (1) before many times and it works. Here is an example where all three syntax work
pde:=diff(u(x,t),t)=k*diff(u(x,t),x$2);
bc:=eval(diff(u(x,t),x),x=0)=0,u(L,t)=0;
ic:=u(x,0)=f(x);
sol:=pdsolve([pde,bc,ic],u(x,t));
pdsolve gives
![]()
Using syntax (2)
pde:=diff(u(x,t),t)=k*diff(u(x,t),x$2);
bc:=D[1](u)(0,t)=0,u(L,t)=0;
ic:=u(x,0)=f(x);
sol:=pdsolve([pde,bc,ic],u(x,t));
![]()
gives same answer as (1) and using syntax (3)
pde:=diff(u(x,t),t)=k*diff(u(x,t),x$2);
bc:=D[1]*u(0,t)=0,u(L,t);
ic:=u(x,0)=f(x);
sol:=pdsolve([pde,bc,ic],u(x,t));
![]()
The answer also looks like different and simpler, but I assume they are equivalent for now without looking too much into it.
Which syntax should one use as now I am really confused.
It looks like (3) is the one that should be used? Why the others did not work on first example? i.e. pdsolve did not give an answer at all? And if (1,2,3) syntax are supposed to be equivalent, whysecond example gives slightly different looking answer when using one syntax vs. the other?
And finally to make things more confusing, here is an example where syntax (3) does not work, but syntax 1 and 2 work:
#articolo example 8.4.3
restart;
pde := diff(u(x, t), t) = (1/20)*(diff(u(x, t), x, x))+t;
bc := u(0, t) = 5, (u(1, t)+ D[1](u)(1, t)) = 10;
ic:= u(x, 0) = -40*x^2*(1/3)+45*x*(1/2)+5;
pdsolve([pde, bc,ic], u(x, t))
gives answer.
restart;
pde := diff(u(x, t), t) = (1/20)*(diff(u(x, t), x, x))+t;
bc := u(0, t) = 5, (u(1, t)+eval(diff(u(x,t),x),x=1)) = 10;
ic:= u(x, 0) = -40*x^2*(1/3)+45*x*(1/2)+5;
pdsolve([pde, bc,ic], u(x, t))
gives same answer. But
restart;
pde := diff(u(x, t), t) = (1/20)*(diff(u(x, t), x, x))+t;
bc := u(0, t) = 5, (u(1, t)+ D[1]*u(1, t)) = 10;
ic:= u(x, 0) = -40*x^2*(1/3)+45*x*(1/2)+5;
pdsolve([pde, bc,ic], u(x, t))
does not work.
Clearly there is something I do not understand between these 3 syntaxes and when to use which.
Using 265 version
Physics:-Version() "C:\Maple_updates\Physics+Updates.maple", 2018, December 22, 10:41 hours, version in the MapleCloud: 265, version installed in this computer: not installed
downloaded today.