Ask Your Question

Revision history [back]

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.

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")

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()

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()

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)

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)

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.