0
$\begingroup$

Consider the following simple example where I try to solve an equation and then apply a bounded interval to find the right result out of an infinite amount of solutions:

Eq4 = -1 == (Cos[δ] Sin[t])/(Cos[φ ] Sin[δ] - Cos[t] Cos[δ] Sin[φ])    
tS = Simplify[(Reduce[Eq4, {t}] /. {δ -> -0.401426, φ -> 0.841248699}) && (0 < t < π/2)]

(* Out:
C[1] ∈ Integers && (t == -2.72982 + 2 π C[1] || t == 0.869424 + 2 π C[1]) && 0 < t < π/2
*)

Why isn't the last one just simplified to t == 0.869424 and how can I achieve it?

$\endgroup$
4
  • $\begingroup$ First@Solve[0 <= t <= \[Pi]/2 && Reduce[Eq4, {t}] /. {\[Delta] -> -0.401426, \[CurlyPhi] -> 0.841248699}, {t, C[1]}] $\endgroup$
    – march
    Jan 28 '16 at 0:34
  • $\begingroup$ You can simply include the domain restriction in your system of equations instead. A simple Reduce[{Eq4, 0 < t < Pi/2} /. {δ -> -0.401426, φ -> 0.841248699}, t] readily returns t == 0.869424. $\endgroup$
    – MarcoB
    Jan 28 '16 at 1:38
  • $\begingroup$ @MarcoB and march: Both of your solutions work. However in both cases I get the warning "Solve/Reduce was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result.". It would be nice, but not necessary to get rid of it. If you post your comments as answers I'll accept (one of) them. $\endgroup$
    – Scindix
    Jan 28 '16 at 13:02
  • $\begingroup$ @march see above comment. $\endgroup$
    – Scindix
    Jan 28 '16 at 13:02
0
$\begingroup$

You can simply include the domain restriction in your system of equations instead:

Eq4 = -1 == (Cos[δ] Sin[t])/(Cos[φ ] Sin[δ] - Cos[t] Cos[δ] Sin[φ])    
Reduce[{Eq4, 0 < t < Pi/2} /. {δ -> -0.401426, φ -> 0.841248699}, t] 
(* Out: t == 0.869424 *)

Reduce complains that it "was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result". That really does not influence the result you get in this case, but if it bothers you, you could

1) provide exact values for δ and φ;

2) Rationalize the numerical ones you have as follows:

Reduce[{Eq4, 0 < t < Pi/2} /. Rationalize[{δ -> -0.401426, φ -> 0.841248699}, 0], t] // N
(* Out: t == 0.869424 *)

3) simply suppress the printing of the message using Quiet:

Quiet@Reduce[{Eq4, 0 < t < Pi/2} /. {δ -> -0.401426, φ -> 0.841248699}, t]
$\endgroup$

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.