Question: Why is pdsolve a module? How do I derivatives of a solution?

restart;
Here is my pde and a procedure that plots the solution.
K1:=proc(g)
uses PDEtools,plots:
local pde, ic,ans;
pde:=-4*x*diff(f(u,x),u,x)+4*diff(f(u,x),u)=x^4*diff(f(u,x),x,x)+x^3*diff(f(u,x),x)+8*x^2*f(u,x)*(1-f(u,x)^2);
ic:={f(u,0) = 1, f(u,1) = 0,f(0,x)=g};
ans:=pdsolve(pde,ic,numeric,compile=true,time=u,range=0..1,'spacestep'=0.005);
ans:-plot(u=3)
end proc:
K1(1+x^2-2*x^3);

It works just fine; I get a plot of f(u,x) for u =3.  (Note that unlike dsolve there is no complaint about the global variable g in the initial conditions.)
Now I want to see a plot of diff(f(u,x) for u=3.
K2:=proc(g)
uses PDEtools,plots:
local pde, ic,ans;
pde:=-4*x*diff(f(u,x),u,x)+4*diff(f(u,x),u)=x^4*diff(f(u,x),x,x)+x^3*diff(f(u,x),x)+8*x^2*f(u,x)*(1-f(u,x)^2);
ic:={f(u,0) = 1, f(u,1) = 0,f(0,x)=g};
ans:=pdsolve(pde,ic,numeric,compile=true,time=u,range=0..1,'spacestep'=0.005);
ans:-plot([diff(f(u,x),x,u),color=cyan],u=3)
end proc:
K2(1+x^2-2*x^3);

That does not work.

I try to introduce a new variable h(u,x) = diff(f(u,x),x) so that I can plot h(u,x).
K3:=proc(g)
uses PDEtools,plots:
local pde, ic,ans;
pde:={h(u,x)=diff(f(u,x),x),
-4*x*diff(h(u,x),u)+4*diff(f(u,x),u)=x^4*diff(h(u,x),x)+x^3*h(u,x)+8*x^2*f(u,x)*(1-f(u,x)^2)};
ic:={f(u,0) = 1,f(u,1) = 0,f(0,x)=g};
ans:=pdsolve(pde,ic,numeric,compile=true,time=u,range=0..1,'spacestep'=0.005);
ans:-plot(h(u,x),u=3)
end proc:

K3(1-x^2);
Error, (in pdsolve/numeric/par_hyp) Incorrect number of initial conditions, expected 2, got 1

I have no idea what Maple is referring to; there are 3 initial conditions, not 1 or 2.

Anybody know what is going on? Any idea how to get what I need?

One more comment. I have never knowingly used a module in all the years I have been using and teaching Maple. I am sure there are good reasons for the construct but I think it would be difficult to teach. For ode's the result of dsolve is a procedure and it is relatively easy to teach because procedures are the bread and butter of using Maple. Why does pdsolve return a module?  I spent a good deal of time figuring out the use of pdsolve and would not like to force my students to do the same. I get them up to speed solving ode's using dsolve and DETools in a one hour lab. I wonder how much time it would take to do pdsolve.

 

Please Wait...