Question: why dsolve and odeadvisor fail to process parsed ode?

I can't figure why dsolve and odeadvisor fail to process ode when it is parsed from string and only inside a proc, but works ok in global space.

This works OK:

restart;
ode  :=  :-parse("diff(y(x),x$2)=0"):
func := :-parse("y(x)"):

dsolve(ode);
DEtools:-odeadvisor(ode,func);

But the same code, when inside a proc, fail

restart;
foo:=proc()
  local ode,func;  
  local x,y; #adding this did not  help

  ode  :=  :-parse("diff(y(x),x$2)=0");
  func :=  :-parse("y(x)");

  dsolve(ode);
  try
     DEtools:-odeadvisor(ode,func);
  catch:
     error lastexception;
  end try;

end proc;

foo()

It seems to have with name scoping, but I do not see what is the problem. :-parse works fine.

How to resolve this? Since I must use :-parse as I am reading the ode as string from database with Maple as string from inside a proc inside a module and the above is just a simple example that shows the problem.

Maple 2020.1 with Physics 724

Please Wait...