Solving large trigonometric fucntions
Hi everyone,
I'm new to sage and would like to use it to give me an exact solution to the derivative of a large trig function. I have been tinkering around with the different trig simplification routines to no avail. Here is the current incarnation of my code:
var("theta phi r I sigma_a1 sigma_a2 M_1 M_2 F_tu")
import sympy as sy
M1(phi)=M_1*cos(phi+pi/2)
M1=M1.trig_reduce()
M2(phi)=M_2*cos(phi+theta+pi/2)
M2=M2.trig_reduce()
sigma_b1(r,phi)=M1(phi - pi/2)*r/I+sigma_a1
sigma_b1=sigma_b1.trig_reduce()
sigma_b2(r,phi)=M2(phi - pi/2)*r/I+sigma_a2
sigma_b2=sigma_b2.trig_reduce()
sigma_alt(r,phi)=sigma_b1-sigma_b2
sigma_alt=sigma_alt.trig_reduce()
sigma_mean(r,phi)=(sigma_b1-sigma_b2)/2
sigma_mean=sigma_mean.trig_reduce()
sigma_alteq(r,phi)=F_tu*sigma_alt/(F_tu-sigma_mean)
sigma_alteq=sigma_alteq.trig_reduce()
sol=diff(sigma_alteq,phi)
sol_reduc=SR(sy.fu(sy.sympify(sol))); sol_reduc
show(sol_reduc)
solve(sol_reduc,phi)
Sorry, I do not know how to make the code appear in a window. The final result it gives me is:
[sin(phi + theta) == M_1*sin(phi)/M_2]
Can someone please help me or at least point me in the right direction. Thanks.
Could you please tell us which result would you expect ?
@Kevin_Bryant
To display blocks of code, either indent them with 4 spaces, or select the corresponding lines and click the "code" button (the icon with '101 010').
Can you edit your question to do that?
@tmonteil I was expecting a set of 4 solutions over the interval of 0 to 2*pi for phi. I solved this problem earlier on Wolframalpha before I added the terms sigma_a1 and sigma_a2 to my equations and got the following for one solution (note that variable names are different but the problem was essentially the same)
t = -cos^(-1)((-sqrt((2 F X Y^2 Z cos(2 a) - 2 F X Y^2 Z)^2 - 4 (-4 F^2 X Y cos(a) + 2 F^2 X^2 + 2 F^2 Y^2) (4 F^2 X Y cos(a) - F^2 Y^2 cos(2 a) - X^2 Y^2 Z^2 cos(2 a) - 2 F^2 X^2 - F^2 Y^2 + X^2 Y^2 Z^2)) - 2 F X Y^2 Z cos(2 a) + 2 F X Y^2 Z)/(2 (-4 ...(more)
@slelievre thanks and done