1
$\begingroup$

I've been trying to solve the following equations in order to plot Subscript[θ, 41] with respect to Subscript[θ, 2] from 0 to 360 degrees.

enter image description here

Subscript[r, 1] = 38.79;
Subscript[r, 2] = 15;
Subscript[r, 3] = 50;
Subscript[r, 41] = 41.5;
Subscript[θ, 1] = 191.6 Degree;

Eq1 = Subscript[r, 1] Cos[Subscript[θ, 1]] == 
        (Subscript[r, 2] Cos[Subscript[θ, 2] \[Degree]] + 
         Subscript[r, 3] Cos[Subscript[θ, 3] \[Degree]] + 
         Subscript[r, 41] Cos[Subscript[θ, 41] \[Degree]])

Eq2 = Subscript[r, 1] Sin[Subscript[θ, 1]] == 
        (Subscript[r, 2] Sin[Subscript[θ, 2] \[Degree]] + 
         Subscript[r, 3] Sin[Subscript[θ, 3] \[Degree]] + 
         Subscript[r, 41] Sin[Subscript[θ, 41] \[Degree]])

Plot[(Subscript[θ, 41] /. 
        NSolve[{Eq1, Eq2}, {Subscript[θ, 3], Subscript[θ, 41]}][[2]]) + 360, 
        {Subscript[θ, 2], 0, 360} , PlotRange -> {{0, 360}, {240, 300}}]

Solution = (Subscript[θ, 41] /. 
        NSolve[{Eq1, Eq2}, {Subscript[θ, 3], Subscript[θ, 41]}][[2]]) + 360;

Plot[Solution, {Subscript[θ, 2], 0, 360}]

The solution of this gives 4 solutions for Subscript[θ, 41]. The problem is, whenever I try to plot one of those solutions by putting the whole Solve phrase in the Plot statement, it works. But whenever I try to do them separately, it gives a completely different plot.

More details shown in the following photos:

enter image description here

The first plot is the one I'm looking for. The second one gives a different plot!... Although I technically haven't done anything different.

I think it's important to mention that I've noticed that the strange plot I got (the second one) is somehow a combination of all 4 solutions. It's typical to a certain solution in a certain range of Theta's, then flips to another solution in another range. I don't know how this helps.

I hope someone would explain this to me, thank you !!

$\endgroup$
  • $\begingroup$ Please add your code in a copyable format instead or in addition to the picture. $\endgroup$ – Karsten 7. Dec 11 '15 at 21:35
  • $\begingroup$ Possibly the two plots are different due to the fact that Plot has attribute HoldAll or that it effectively is using Block for Theta2. $\endgroup$ – Karsten 7. Dec 11 '15 at 21:37
  • $\begingroup$ @Karsten7. I've added my code at the top of my post. $\endgroup$ – Abdelrahman Fikry Elashry Dec 11 '15 at 21:56
  • 1
    $\begingroup$ @bbgodfrey The first plot produces something, because Subscript[\[Theta], 2] has a value at every point Plot evaluates that NSolve[...]. It is very similar to the situation here. $\endgroup$ – Karsten 7. Dec 12 '15 at 0:17
  • 1
    $\begingroup$ I'm voting to close this question as off-topic because it is too localized; i.e, it applies only to the local situation and needs of its poster and answers will not benefit others. $\endgroup$ – m_goldberg Feb 22 '16 at 15:45