Question: how to select terms from one expression into 2 different expressions

I am trying separation of variables in Maple. I get an equation that has the form   

And now I want to tell Maple to assign the terms with 1/R in them to one variable, say eq21, and the term with 1/Z to second variable, say eq22 The idea is that I can later more easily work with each separate ode. 

I do not know to separate those apart. I could offcourse copy and paste by hand, but I want to automate this.

I tried match() and patmatch() but I am not seeing the way. Here is the code:

restart;
T:=  (r,z)-> Z(z)*R(r);
eq1:= diff(T(r,z),r$2)+1/r*diff(T(r,z),r)+diff(T(r,z),z$2);
eq2:=expand(eq1/(Z(z)*R(r)));

#need now way to break the above into 2 different variables.

ps. I know I can do this:

restart;
T:=  (r,z)-> Z(z)*R(r);
eq1:= diff(T(r,z),r$2)+1/r*diff(T(r,z),r)+diff(T(r,z),z$2);
eq2:=expand(eq1/(Z(z)*R(r)));
eq3:=collect(eq2,1/R(r));
eq21:=op(1,eq3);
eq22:=op(2,eq3);

But this for me is not the right way to do it. I think there should be more algebraic way.

 

Please Wait...