I try to solve a system of equations:

m2 a2y == -g m2 + n,
m1 a1x ==  Sin[θ] n Exp[μ θ],
m1 a1y == -g m1 + Cos[θ] n Exp[μ θ],
   a2y ==  Sqrt[a1x^2 + a1y^2] Sin[θ - ArcTan[a1y/a1x]]

for a1x, a1y, a2y and n. When I use Solve[] function it doesn't do anything for a looong time, but doesn't show any error. Is this system unsolvable or does Mathematica just need a lot of time to solve it?

  • $\begingroup$ Can you show the code you use to try to solve this? It could be something as simple as a typo, but without code it will be difficult to diagnose. Have you tried Solve on a very simple system that you can verify by hand to make sure you're using the command correctly, for instance? $\endgroup$ – N.J.Evans Oct 25 '18 at 18:56
  • 1
    $\begingroup$ My code: 'equ = {m2 a2y == -g m2 + n, m1 a1x == Sin[[Theta]] n Exp[[Mu] [Theta]], m1 a1y == -g m1 + Cos[[Theta]] n Exp[[Mu] [Theta]], a2y == Sqrt[a1x^2 + a1y^2] Sin[[Theta] - ArcTan[a1y/a1x]]}; Solve[equ, {a1x, a1y, a2y, n}]' $\endgroup$ – Meeso Oct 25 '18 at 23:58

It can be done much quicker if you break it up by noticing the first 3 equations are fairly simple.

eq1 = m2 a2y == -g m2 + n;
eq2 = m1 a1x == Sin[\[Theta]] n Exp[\[Mu] \[Theta]];
eq3 = m1 a1y == -g m1 + Cos[\[Theta]] n Exp[\[Mu] \[Theta]];
eq4 = a2y == Sqrt[a1x^2 + a2x^2] Sin[\[Theta] - ArcTan[a1y/a1x]];

sol = Solve[{eq1, eq2, eq3}, {a2y, a1x, a1y}] // Flatten
(*{a2y -> (n - g m2)/m2, a1x -> (n E^(θ μ) Sin[θ])/m1,
  a1y -> (n E^(θ μ) Cos[θ] - g m1)/m1}*)

a2y = a2y /. sol
a1x = a1x /. sol
a1y = a1y /. sol

Solve[eq4, a2x] // Simplify

We get 2 fairly lengthy answers(plus and minus) that I will not post here, but the result is returned immediately.

  • 1
    $\begingroup$ OP want find: {a1x, a1y, a2y, n} not {a1x, a1y, a2y, a2x} ? $\endgroup$ – Mariusz Iwaniuk Oct 25 '18 at 20:39
  • $\begingroup$ I had a wrong variable in the last equation (a2x instead of a1y), and as it worked perfectly before, now it doesn't. $\endgroup$ – Meeso Oct 25 '18 at 23:56

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.