I have a term f[p] that is composed of unknown parameters U = {U1, U2...}and known parameters K={K1,K2...} and functions related to this so
f[p] = fu[U]*fk[K]
Thee two functions are assumed to all be constituted by factors multiplied by each other, for instance like this
f[p]= U1^3*Cos[ U1+U2]*Sin[K2]*K3^2 *sqrt[K4 +tan[K5] ]
Inner functions taking both unknown and known parameters are forbidden, so for instance Cos[U1+K2] should generate an error.
What I want is a function that is fed with the info {U,K} and then automatically splits f(p) into the two functions f[U] and fk[K].
So far I used FactorList[] to get all the constitutents of f[p].
factors = FactorList[f[p]] ={ {U1,3},{Cos[ U1+U2],1}, etc}
My idea is to analyse each factor in this list and see if it's a function of either known or unknown parameters. After each analysis each element is then put aside fo form
f[U] =U1^3*Cos[ U1+U2]
f[K]= K1*Sin[K2]*K3^2 *sqrt[K4 +tan[K5] ]
I guess Cases[] can be used somehow. If any element in factor contains either an element from U or K it should be put aside. This is where I need help, how to do this? :)