I manipulate equations which are trigonometric equations in mechanics. In theses equations, the custom is to use only Cos, Sin and Tan functions and not the secant and cosecant functions.
To prevent Mathematica’s use of these functions, I found this code in this forum:
$PrePrint = # /. {Csc[z_] :> 1/Defer@Sin[z],
Sec[z_] :> 1/Defer@Cos[z],
Cot[z_] :> Defer@Cos[z]/Defer@Sin[z]} &;
This code worked well until now.
But, at the moment, I need to made some substitutions in a expression and I can’t make it work.
Here the two rules that I want to use in my substitutions:
RègleCΦ = (Cos[Φ] -> Cos[η2] Cos[ψ2] + Sin[η2] Sin[θ2] Sin[ψ2])
RègleSΦ = (Sin[Φ] -> (-Cos[ψ2] Sin[η2] Sin[θ2] + Cos[η2] Sin[ψ2])/(Cos[η2] Cos[θ2] Cos[ϕ2] - Sin[θ2] Sin[ϕ2]))
Here is the equation where I want to conduct these substitutions :
(-((Cos[θ2] Cos[Φ] Sin[η2])/Sin[Φ]) == -Cos[ϕ2] Sin[θ2] -
Cos[η2] Cos[θ2] Sin[ϕ2]) /. {RègleCΦ, RègleSΦ}
The substitution doesn't work.
Can you help me to find a solution to conduct these substitutions?
A solution which keeps the same definitions of the rules would be great.
Note: when I obtained a ‘FullForm’ of the expression, I noticed that it contains some ‘Defer’ function. I wonder if my problem comes from this. But, I need to find a solution which allows me : 1) to prevent Mathematica from using secant and cosecant functions; and 2) to easily carry out substitutions in expressions or equations using rules.
Here the FullForm of the expression :
SetSystemOptions[ "SimplificationOptions" -> "AutosimplifyTrigs" -> False]
(from one of the answers to the first duplicate)? It "works" for me. $\endgroup$