I know there have been very similar questions to this on this forum and I have already gone through them and unfortunately I am not yet convinced of the result that I have achieved.
I am trying to solve a system of three simultaneous equations, but the catch is that all of the equations are symbolic and what I actually mean by 'solving the equations' is writing the 'symbolic unknowns' in terms of the rest of the symbols or the supposedly known values.
I have posted my code below and I have pretty much tried to apply one of the examples in the Mathworks website. What happens is the code runs and Matlab remains in the busy state for a very long time and then it ends up saying that it cannot solve the equation.
In other similar examples that I had seen, people had done something similar and peculiarly enough, no one complained about the long waiting time. Is this supposed to take a long time? What am I doing wrong or can change to get what I am after? Here is my code:
L2 = sym('L2');
L1 = sym('L1');
L3 = sym('L3');
theta1 = sym('theta1');
theta2 = sym('theta2');
theta3 = sym('theta3');
x = sym('x');
y = sym('y');
z = sym('z');
eqn1 = cos(theta1)*(L1 + L3*cos(theta2 + theta3) + L2*cos(theta2)) == x
eqn2 = sin(theta1)*(L1 + L3*cos(theta2 + theta3) + L2*cos(theta2)) == y
eqn3 = L3*sin(theta2 + theta3) + L2*sin(theta2) == z
sol = solve([eqn1,eqn2,eqn3],[theta1,theta2,theta3]);