So, I've been trying to solve this nonlinear complex 12x12 equation system
sym l2x l2y l3x l3y phi1 phi2 phi3 phi4 phi5 phi6 l1x l1y
Error using sym
Too many input arguments.
e1=l1x*(exp(-i*alfa(1))-1)+l2x*(exp(-i*phi1))-l3x*(exp(-i*rho(1)));
e2=l1y*(exp(-i*alfa(1))-1)+l2y*(exp(-i*phi1))-l3y*(exp(-i*rho(1)));
e3=l1x*(exp(-i*alfa(2))-1)+l2x*(exp(-i*phi2))-l3x*(exp(-i*rho(2)));
e4=l1y*(exp(-i*alfa(2))-1)+l2y*(exp(-i*phi2))-l3y*(exp(-i*rho(2)));
e5=l1x*(exp(-i*alfa(3))-1)+l2x*(exp(-i*phi3))-l3x*(exp(-i*rho(3)));
e6=l1y*(exp(-i*alfa(3))-1)+l2y*(exp(-i*phi3))-l3y*(exp(-i*rho(3)));
e7=l1x*(exp(-i*alfa(4))-1)+l2x*(exp(-i*phi4))-l3x*(exp(-i*rho(4)));
e8=l1y*(exp(-i*alfa(4))-1)+l2y*(exp(-i*phi4))-l3y*(exp(-i*rho(4)));
e9=l1x*(exp(-i*alfa(5))-1)+l2x*(exp(-i*phi5))-l3x*(exp(-i*rho(5)));
e10=l1y*(exp(-i*alfa(5))-1)+l2y*(exp(-i*phi5))-l3y*(exp(-i*rho(5)));
e11=l1x*(exp(-i*alfa(6))-1)+l2x*(exp(-i*phi6))-l3x*(exp(-i*rho(6)));
e12=l1y*(exp(-i*alfa(6))-1)+l2y*(exp(-i*phi6))-l3y*(exp(-i*rho(6)));
result=solve(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12)
Sadly I have an error, it says error usingSyms, too many input arguments
Here's the full code:
%Point imput and reference axis change
clc
clear all
L=82.4;
L1=35.7;
L2=39.7;
Px=[3.83066 20.5384 -25.4442 -18.651 -7.17219 11.2119 -3.91001];
Py=[8.73631 11.8334 2.29626 1.0213 0.039011 2.07465 5.5248];
for j=1:7
PX(j)=Px(j);
PY(j)=Py(j)-L;
end
% Angles
for j=1:7
f = @(theta) [L1*cos(theta(1))+L2*cos(theta(2))-PX(j); L1*sin(theta(1))+L2*sin(theta(2))-PY(j)];
p=[0.24 0.245];
thetA=fsolve(f,p);
Theta1(j)=thetA(1);
Theta2(j)=thetA(2);
Theta1_Grados(j)=360+Theta1(j)*(360/(2*3.141516))
Theta2_Grados(j)=360+Theta2(j)*(360/(2*3.141516))
end
for j=1:6
alfa(j)=Theta1(j+1)-Theta1(j);
rho(j)=alfa(j)+0.17;
end
%Sistemas de ecuaciones
sym l2x l2y l3x l3y phi1 phi2 phi3 phi4 phi5 phi6 l1x l1y
e1=l1x*(exp(-i*alfa(1))-1)+l2x*(exp(-i*phi1))-l3x*(exp(-i*rho(1)));
e2=l1y*(exp(-i*alfa(1))-1)+l2y*(exp(-i*phi1))-l3y*(exp(-i*rho(1)));
e3=l1x*(exp(-i*alfa(2))-1)+l2x*(exp(-i*phi2))-l3x*(exp(-i*rho(2)));
e4=l1y*(exp(-i*alfa(2))-1)+l2y*(exp(-i*phi2))-l3y*(exp(-i*rho(2)));
e5=l1x*(exp(-i*alfa(3))-1)+l2x*(exp(-i*phi3))-l3x*(exp(-i*rho(3)));
e6=l1y*(exp(-i*alfa(3))-1)+l2y*(exp(-i*phi3))-l3y*(exp(-i*rho(3)));
e7=l1x*(exp(-i*alfa(4))-1)+l2x*(exp(-i*phi4))-l3x*(exp(-i*rho(4)));
e8=l1y*(exp(-i*alfa(4))-1)+l2y*(exp(-i*phi4))-l3y*(exp(-i*rho(4)));
e9=l1x*(exp(-i*alfa(5))-1)+l2x*(exp(-i*phi5))-l3x*(exp(-i*rho(5)));
e10=l1y*(exp(-i*alfa(5))-1)+l2y*(exp(-i*phi5))-l3y*(exp(-i*rho(5)));
e11=l1x*(exp(-i*alfa(6))-1)+l2x*(exp(-i*phi6))-l3x*(exp(-i*rho(6)));
e12=l1y*(exp(-i*alfa(6))-1)+l2y*(exp(-i*phi6))-l3y*(exp(-i*rho(6)));
result=solve(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12)

 Réponse acceptée

KSSV
KSSV le 14 Juin 2022
Modifié(e) : KSSV le 14 Juin 2022

1 vote

Replace sym with syms.
Instead of i (complex number) 1i is preferred.

4 commentaires

Hi, thanks, it solved it but the results were pure zeros
Torsten
Torsten le 14 Juin 2022
Yes, it's a solution ...
any way to get another solution?
José David Castillo Blanco
José David Castillo Blanco le 14 Juin 2022
Modifié(e) : José David Castillo Blanco le 14 Juin 2022
Digged a little about the command, inserted an initial guess, now I have another solution but apparently is on complex numbers which doesn't help me for my mechanism synthesis.
Thanks for the help anyways

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by