0
$\begingroup$

I would like to make simplification of trigonometric expressions by using a replacement a group of variables.

Here the equation I have to simplify :

   -Cos[γ[1][t] - θ[1][t] - ψ[1][t]] l[f] + 
  m[f] Sin[γ[1][t]] + 
  c[f] Sin[γ[1][t] - θ[1][t]] - 
  h[f] Sin[γ[1][t] - θ[1][t] - ψ[1][t]] + 
  x[P1][
   t] == -Cos[γ[2][t] - θ[2][t] - ψ[2][t]] l[f] + 
  m[f] Sin[γ[2][t]] + 
  c[f] Sin[γ[2][t] - θ[2][t]] - 
  h[f] Sin[γ[2][t] - θ[2][t] - ψ[2][t]] + 
  x[P2][t]

For the simplification I also this equation

γ[1][t] - θ[1][t] - ψ[1][t] == γ[2][t] - θ[2][t] - ψ[2][t]

Consequently, I would like to replace only in the right hand side the group of variables γ[2][t] - θ[2][t] - ψ[2][t] by γ[1][t] - θ[1][t] - ψ[1][t]

After simplifications, I would like to obtain this equation :

m[f] Sin[γ[1][t]] + c[f] Sin[γ[1][t] - θ[1][t]] + x[P1][t] == 
  m[f] Sin[γ[2][t]] + c[f] Sin[γ[2][t] - θ[2][t]] + x[P2][t]

Have you some ideas so to do this replacement γ[1][t] - θ[1][t] - ψ[1][t] == γ[2][t] - θ[2][t] - ψ[2][t] in the right hand side of my equation ?

$\endgroup$

1 Answer 1

2
$\begingroup$

try this:

FullSimplify[
   -Cos[γ[1][t] - θ[1][t] - ψ[1][t]] l[f] + m[f] Sin[γ[1][t]] + 
   c[f] Sin[γ[1][t] - θ[1][t]] - h[f] Sin[γ[1][t] - θ[1][t] - ψ[1][t]] + 
   x[P1][t] == (-Cos[γ[2][t] - θ[2][t] - ψ[2][t]] l[f] + m[f] Sin[γ[2][t]] + 
   c[f] Sin[γ[2][t] - θ[2][t]] - h[f] Sin[γ[2][t] - θ[2][t] - ψ[2][t]] + 
   x[P2][t]) /. (γ[2][t] - θ[2][t] - ψ[2][t]) -> (γ[1][t] - θ[1][t] - ψ[1][t])
]
$\endgroup$
3
  • $\begingroup$ is it the "{", "}" which enable to make the replacement of a group of variables ? $\endgroup$
    – Bendesarts
    Mar 13, 2016 at 8:20
  • $\begingroup$ it is /. symbol in the answer that allows you to make the replacement. $\endgroup$
    – Ali Hashmi
    Mar 13, 2016 at 8:21
  • $\begingroup$ i removed the "{" "}" because they were not necessary. $\endgroup$
    – Ali Hashmi
    Mar 13, 2016 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.