Message Boards Message Boards

Solve::nsmet: This system cannot be solved

Posted 1 year ago

Hi, I need to solve the following equation for 'r' in Mathematica:

u := Cos[r]*(-a) - Sin[r]*(-c) + x
v := Sin[r]*(-a) + Cos[r]*(-c) + y
t := Cos[r]*(b) - Sin[r]*(-c) + x
m := Sin[r]*(b) + Cos[r]*(-c) + y
n := y
l := x
\[Alpha] := ArcTan[v, u] + ArcTan[0, u]
\[Beta] := -(ArcTan[m, (t - d)] + ArcTan[0, (t - d)])
\[CurlyPhi] := Cos[\[Beta]]/Sin[\[Alpha] + \[Beta]]
\[Rho] := Cos[\[Alpha]]/Sin[\[Alpha] + \[Beta]]
o := u - l
p := v - n
s := t - l
f := m - n
\[Gamma] := (-u)*\[CurlyPhi]/Sqrt[u^2 + v^2]
\[Delta] := (-v)*\[CurlyPhi]/Sqrt[u^2 + v^2]
\[Epsilon] := (d - t)*\[Rho]/Sqrt[(t - d)^2 + m^2]
\[Kappa] := (-m)*\[Rho]/Sqrt[(t - d)^2 + m^2]
g := o*\[Delta] - p*\[Gamma]
h := s*\[Kappa] - f*\[Epsilon]
ExpandAll[g + h == 0]
Solve[ExpandAll[g + h == 0], r]

but I get an error Solve::nsmet: This system cannot be solved with the methods available to Solve. I'm beginner with the software, the constants are {a,b,c,d,x,y}, Can this equation be solved? What do I am doing wrong? please. Thanks.

4 Replies

The following transforms the equation into a polynomial system, so theoretically, Solve[] will think it's solvable. However, I don't know if it's practically solvable. For me it's not, since I'm unwilling to let it run long enough to find out.

I post it in case you want to play with it. I save a denominator ghD in case it's needed to rule out spurious solutions should any solutions ever be found. The system could be simplified with assumptions (e.g., U or V could be eliminated by assuming positivity, which would reduce the degree of the system).

Note r is given by ArcTan[X, Y] if solutions for X and Y are ever found.

gh = Simplify[TrigExpand[g + h] /. {Cos[r] -> X, Sin[r] -> Y}, 
  X^2 + Y^2 == 1]
{ghN, ghD} = NumeratorDenominator[gh]
xf = Transpose@Block[{i = 0},
   DeleteDuplicates@Cases[ghN, Power[_, 1/2], Infinity] /. 
    Power[u_, 
      1/2] :> {Power[u, 1/2] -> {U, V}[[++i]], {U, V}[[i]]^2 == u}
   ]
sys = Join[Last[xf], {ghN == 0 /. First[xf], X^2 + Y^2 == 0}]

(*
{U^2 == (x - a X + c Y)^2, V^2 == (-d + x + b X + c Y)^2, 
 2 b U (-d + x) (c x - a y) + U (b^2 + (d - x)^2) X (c x - a y) - 
   2 a V x (c (-d + x) + b y) + V (a^2 + x^2) X (c (-d + x) + b y) + 
   2 U (-d + x) X (a b x + c^2 x - a c y + b c y) Y + 
   2 V x X (c (c (-d + x) + b y) - a (b (d - x) + c y)) Y + 
   V (2 a c (c (d - x) - b y) + a^2 (b (d - x) + c y) + 
      x^2 (b (d - x) + c y)) Y + 
   U (a (b^2 x + (d - x)^2 x - 2 b c y) + 
      c (2 b c x + b^2 y + (d - x)^2 y)) Y + 
   2 U (-d + x) (a c x - b c x + a b y + c^2 y) Y^2 + 
   2 V x (b c (d - x) + a c (-d + x) + a b y + c^2 y) Y^2 + 
   V X (a^2 (c (d - x) - b y) + c^2 (c (-d + x) + b y) - 
      2 a c (b (d - x) + c y)) Y^2 + 
   U X (c (-b^2 x + c^2 x + 2 b c y) + 
      a (2 b c x + b^2 y - c^2 y)) Y^2 + 
   V (2 a c (c (-d + x) + b y) - a^2 (b (d - x) + c y) + 
      c^2 (b (d - x) + c y)) Y^3 + 
   U (a (-b^2 x + c^2 x + 2 b c y) + 
      c (-2 b c x - b^2 y + c^2 y)) Y^3 == 0, X^2 + Y^2 == 0}
*)
POSTED BY: Michael Rogers

Thanks I will try.

I very much doubt that you can find a formula for the solutions with symbolic parameters. You can try numerically for specific numerical values for the parameters. For example, setting all parameters equal to 1 you get two numerical solutions:

expr = Simplify[g + h /. Thread[{a, b, c, d, x, y} -> 1]]
Plot[expr, {r, 0, 2 Pi}]
NSolve[expr == 0 && 0 < r < 2 Pi, r]
POSTED BY: Gianluca Gorni

Thanks

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract