Clear Filters
Clear Filters

Solutions aquired with Symbolic Toolbox

2 views (last 30 days)
Hi!
I'm a fairly new user of Symbolic Toolbox, I found it helpful with solving my particular equation primarly constructed in Workspace, from which I import to Toolbox. My algorithm is used to obtain several joint coordinates for a industrial manipulator, limited with M and N degrees. I've made the equations for those q1, q2 and a3 angles basen on my transformation matrices and try to solve them numerically. The code goes as follows:
T03p_1 = subs(T03, {q1, q2, q3, a1, a2, a3}, {3*pi/2,-pi/2,pi,0.26,0.68,0.67});
T03p_2 = subs(T03, {q1, q2, q3, a1, a2, a3}, {-5*pi/4,-pi,pi/4,0.26,0.68,0.67});
T03p_3 = subs(T03, {q1, q2, q3, a1, a2, a3}, {0,-pi/2,-pi/4,0.26,0.68,0.67});
T03p_4 = subs(T03, {q1, q2, q3, a1, a2, a3}, {pi/2,0,pi/2,0.26,0.68,0.67});
T03p_5 = subs(T03, {q1, q2, q3, a1, a2, a3}, {pi,pi/8,(3*pi)/4,0.26,0.68,0.67});
T0ep_1 = subs(T03, {q1, q2, q3, q4, a1, a2, a3}, {3*pi/2,-pi/2,pi, 0,0.26,0.68,0.67});
T0ep_2 = subs(T03, {q1, q2, q3, q4, a1, a2, a3}, {-5*pi/4,-pi,pi/4,-pi/2,0.26,0.68,0.67});
T0ep_3 = subs(T03, {q1, q2, q3, q4, a1, a2, a3}, {0,-pi/2,-pi/4,0,0.26,0.68,0.67});
T0ep_4 = subs(T03, {q1, q2, q3, q4, a1, a2, a3}, {pi/2,0,pi/2,pi/2,0.26,0.68,0.67});
T0ep_5 = subs(T03, {q1, q2, q3, q4, a1, a2, a3}, {pi,pi/8,(3*pi)/4,pi,0.26,0.68,0.67});
P = T0ep_1(:,4);
Pw = T0ep_1(1:4,3);
Pw = Pw *a4;
Pa = P-Pw;
Pax = Pa(1,1);
Pay = Pa(2,1);
Paz = Pa(3,1);
eq1 = simplify(T03(1,4));
eq2 = simplify(T03(2,4));
eq3 = simplify(T03(3,4));
y1 = Pax - eq1;
y2 = Pay - eq2;
y3 = Paz - eq3;
syms z1 z2 z3
nb=mupad;
setVar(nb,'z1',y1);
setVar(nb,'z2',y2);
setVar(nb,'z3',y3);
As far as it goes in MuPAD, here is a screenshot.
As you can see, I have set of non-linear and non-polynomial equations and I'm trying to solve them numerically. The problem is, the solutions are wrong, since I got:
[q1 = -1.449060842, q2 = -0.02512015752, q3 = 0.01051446854]
Where I should receive ones declared in the T03p_1 matrix (3*pi/2,-pi/2,pi)
Do you have any suggestion what might cause this? Should I try to change the equation to polynomial? Do you have any other suggestion how to solve this?
I also tried to use solve() in Matlab while limiting its solutions - however it failed and I don't know the equivalent of assume() in Matlab Editor.
I hope I made my state clear.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!