Hello all,

I have this expression here:

In [50]: print(eqyB_lin)

(Omega**2 + M_b*Omega**2*e*x_GB/I_beta + k_beta/I_beta)*beta(t) + 
Derivative(beta(t), t, t) == 0


which in LaTeX gets rendered like this:

<https://lh5.googleusercontent.com/-Nask81SFlBc/Up0CU_C0NXI/AAAAAAAAASk/sAZJ6UylAEg/s1600/2013-12-02-225634_1366x768_scrot.png>

I'd like to collect Omega squared in the first factor so I can later do a 
substitution. The point is that I'd need an Omega in the denominator of 
k_beta / I_beta. What's the best way to do this in SymPy? Of course I could 
just copy and paste the expression and write it in the way I want but 
that's not what I'm looking for.

One solution I can envision is to traverse the SymPy expression tree, and I 
found this:

http://docs.sympy.org/latest/tutorial/manipulation.html#walking-the-tree
However I cannot think of a way to visit the nodes (the args in this case), 
eventually modify some of them in place and then rebuilding the resulting 
expression. Any pointers on this? Or is there maybe a simpler way?

Thanks in advance, regards

Juan Luis

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to