1 | initial version |
Thank you:
the unfold_refold method in the post of tmonteil is maybe the best solution.
In the approach of nbruin I have following problem: - expr1 is a very very big rational function in s with symbolic coefficients resulting from a solution to a system of linear equations: in the specific from the system of nodal equations of a linear electric circuit in the Laplace domain... The system is solved not for s but for the nodal voltages and s=var('s') will be the complex angular frequency (a parameter).
Because the resulting expressions are very big I am automatically simplifying terms that evaluate to tiny (absolute) values - provided an initial (or typical) value for the circuit paramters.
For rational functions I need the numerator_denominator expressions, but it takes too long to compute them. With FunctionField it goes faster, but I have the conversion problem (in both directions).
I think s must remain symbolic because it is needed in the solution of the system of nodal equations. Or am I wrong here ?
In the answer of nbruin I have to compute numerator and denominator, which IS my problem because of runtime.
So the unfold_refold method can be a good idea: I will try it and let you know...