6
$\begingroup$
    c = 5.; b = 3.; a = 2.; len = 7.5;
u[t_] := Reduce[
  NSolve[(2 c + a Cos[t] - b Cos[u[t]])^2 + (a Sin[t] - b Sin[u[t]])^2 - 
     len^2 == 0], u, Reals]
Plot[u[t], {t, 0, 2 Pi}]

Please help to obtain a simplified output using Reduce. (4-Bar linkage).

enter image description here

$\endgroup$
4
  • $\begingroup$ You're not using NSolve properly - which variable are you solving for? $\endgroup$
    – flinty
    Commented Jul 23, 2020 at 20:53
  • $\begingroup$ Sorry, u[t] corrected typo $\endgroup$
    – Narasimham
    Commented Jul 23, 2020 at 20:56
  • 1
    $\begingroup$ NSolve[(2 c + a Cos[t] - b Cos[u[t]])^2 + (a Sin[t] - b Sin[u[t]])^2 - len^2 == 0] this still doesn't work. What variable are you solving for? $\endgroup$
    – flinty
    Commented Jul 23, 2020 at 21:05
  • $\begingroup$ You are defining a procedural function u[t_] using the expression u[t] symbolically in its definition. This is not a sensible use of recursion. What problem are you trying to solve, exactly? $\endgroup$
    – John Doty
    Commented Jul 23, 2020 at 21:10

2 Answers 2

7
$\begingroup$

You don't need Reduce , try Weirstrass substitution u[t] -> 2 ArcTan[uu]:

Leaving the parameters undefined try

eq = TrigExpand[(2 c + a Cos[t] - b Cos[u[t]])^2 + (a Sin[t] - 
   b Sin[u[t]])^2 - len^2 == 0]
sol = 2 ArcTan[uu] /.Solve[eq /. u[t] -> 2 ArcTan[uu] // TrigExpand, uu]

which gives the two solution branches u[t] in analytical form. {2 ArcTan[(4 a b Sin[ t] - \[Sqrt](-4 (a^2 + b^2 - 4 b c + 4 c^2 - len^2 - 2 a b Cos[t] + 4 a c Cos[t]) (a^2 + b^2 + 4 b c + 4 c^2 - len^2 + 2 a b Cos[t] + 4 a c Cos[t]) + 16 a^2 b^2 Sin[t]^2))/(2 (a^2 + b^2 + 4 b c + 4 c^2 - len^2 + 2 a b Cos[t] + 4 a c Cos[t]))], 2 ArcTan[(4 a b Sin[ t] + \[Sqrt](-4 (a^2 + b^2 - 4 b c + 4 c^2 - len^2 - 2 a b Cos[t] + 4 a c Cos[t]) (a^2 + b^2 + 4 b c + 4 c^2 - len^2 + 2 a b Cos[t] + 4 a c Cos[t]) + 16 a^2 b^2 Sin[t]^2))/(2 (a^2 + b^2 + 4 b c + 4 c^2 - len^2 + 2 a b Cos[t] + 4 a c Cos[t]))]}

Plot[sol /. {c -> 5, b -> 3, a -> 2, len -> 15/2} //Evaluate, {t, 0, 2 Pi}]

enter image description heretps://i.sstatic.net/dEkDP.png

$\endgroup$
5
$\begingroup$
Clear["Global`*"]

c = 5; b = 3; a = 2; len = 15/2;

eqn = (2 c + a Cos[t] - b Cos[u])^2 + (a Sin[t] - b Sin[u])^2 - 
    len^2 == 0 // Simplify

(* 227/4 + 40 Cos[t] == 12 (Cos[t - u] + 5 Cos[u]) *)

sol = u /. 
    Assuming[0 <= t <= 2 Pi, 
     Solve[{eqn, 0 <= t < 2 Pi}, u, Reals, Method -> Reduce] // 
      Simplify] /. C[1] -> 0;

u1[t_] = sol[[1]]

enter image description here

u2[t_] = sol[[2]]

enter image description here

FunctionDomain[#[t], t] & /@ {u1, u2}

enter image description here

%[[1]] // N

3.14159 < t < 4.86928 || 1.4139 < t < 3.14159

Plot[{u1[t], u2[t]}, {t, 0, 2 Pi}, PlotPoints -> 100, 
 MaxRecursion -> 5, PlotLegends -> Placed[{u1, u2}, {0.85, 0.7}]]

enter image description here

For comparison,

ContourPlot[Evaluate@eqn,
 {t, 0, 2 Pi}, {u, -1.35, 1.35},
 AspectRatio -> 1/GoldenRatio]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thanks. How do we include the second solution ( with U looking up? ) $\endgroup$
    – Narasimham
    Commented Jul 24, 2020 at 4:51
  • 1
    $\begingroup$ See edit. You must define two functions since a function cannot be multivalued for any argument. $\endgroup$
    – Bob Hanlon
    Commented Jul 24, 2020 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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