separation of variables
2012-04-01 13:09:23 GMT
I have written a function separable(expr,x,y) that checks if expr is separable into f(x) and g(y) and returns [f,g]. The algorithm is based on Cid (2009), webs.uvigo.es/angelcid/Archivos/Papers/IJMEST.pdf.
But the algorithm sometimes introduces an arbitrary constant, such that it returns [A*f(x),g(y)/A].
Here is an example:
The first example worked fine, but the second one introduced an arbitrary constant (sin(7/2)+5=4.6492... and 1/(sin(7/2)+5)=0.2150...).
Is there a maxima way of finding the greatest common constant factor A in two expressions?
Or is it possible to find the largest subexpression that is independent of x,y?
At the moment I am thinking of using gcd(Ans,1/Ans) and gcd(Ans,1/Ans) and take the one that is independent on x,y as my premultiplication factor, but there may be a better way? Also, are there limitations to the input of gcd that make it fail for more general/exotic input expressions?
_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima