On Mar 21, 4:13 pm, Ben Goodrich <goodrich....@gmail.com> wrote:

> 3) Square both the numerator and denominator to finally get
>
> (((1 - Sigma_12**2/(tau_11**2*tau_22**2)) * (Sigma_34/(tau_33*tau_44)
> - Sigma_13*Sigma_14/(tau_11**2*tau_33*tau_44)) - (Sigma_23/
> (tau_22*tau_33) - Sigma_12*Sigma_13/(tau_11**2*tau_22*tau_33))) / (((1
> - Sigma_13**2/(tau_11**2*tau_33**2))*(1 - Sigma_14**2/
> (tau_11**2*tau_44**2)))**(S(1)/2) * (1 - Sigma_12**2/
> (tau_11**2*tau_22**2))))**2
>
> That would be perfect if I could automate these steps, or it would
> also be okay if it wanted to expand or simplify the numerator further.
> But I haven't been able to figure out how to do that without manual
> intervention. Everything I have tried takes a long time to yield a
> giant expression that still has square root signs. Can anyone get me
> started?

Upon further review, this works

Sigma_12 = Symbol("Sigma_12")
Sigma_13 = Symbol("Sigma_13")
Sigma_14 = Symbol("Sigma_14")
Sigma_23 = Symbol("Sigma_23")
Sigma_24 = Symbol("Sigma_24")
Sigma_34 = Symbol("Sigma_34")

tau_11 = Symbol("tau_11")
tau_22 = Symbol("tau_22")
tau_33 = Symbol("tau_33")
tau_44 = Symbol("tau_44")

expr = ((Sigma_34/(tau_33*tau_44) - Sigma_13*Sigma_14/
(tau_11**2*tau_33*tau_44))/((1 - Sigma_13**2/(tau_11**2*tau_33**2))*(1
- Sigma_14**2/(tau_11**2*tau_44**2)))**(S(1)/2) - (Sigma_24/
(tau_22*tau_44) - Sigma_12*Sigma_14/
(tau_11**2*tau_22*tau_44))*(Sigma_23/(tau_22*tau_33) -
Sigma_12*Sigma_13/(tau_11**2*tau_22*tau_33))/(((1 - Sigma_12**2/
(tau_11**2*tau_22**2))*(1 - Sigma_13**2/(tau_11**2*tau_33**2)))**(S(1)/
2)*((1 - Sigma_12**2/(tau_11**2*tau_22**2))*(1 - Sigma_14**2/
(tau_11**2*tau_44**2)))**(S(1)/2)))

factor(together(expr), frac=True)**2

But that is a somewhat more complicated expression than the manual
simplification. Is there a better way?

Thanks,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to