Solve 3 unknown variable system of equations
显示 更早的评论
syms X Z beta
deg2rad=pi/180;
theta_b=15*deg2rad;
theta_p=15*deg2rad;
R_b=1;
R_p=0.9;
B1=[R_b*cos(15*deg2rad);R_b*sin(15*deg2rad);0];
B2=[R_b*cos(105*deg2rad);R_b*sin(105*deg2rad);0];
B3=[R_b*cos(135*deg2rad);R_b*sin(135*deg2rad);0];
B4=[R_b*cos(225*deg2rad);R_b*sin(225*deg2rad);0];
B5=[R_b*cos(255*deg2rad);R_b*sin(255*deg2rad);0];
B6=[R_b*cos(345*deg2rad);R_b*sin(345*deg2rad);0];
Bx1=B1(1,:);
Bx2=B2(1,:);
Bx3=B3(1,:);
Bx4=B4(1,:);
Bx5=B5(1,:);
Bx6=B6(1,:);
By1=B1(2,:);
By2=B2(2,:);
By3=B3(2,:);
By4=B4(2,:);
By5=B5(2,:);
By6=B6(2,:);
Bz1=B1(3,:);
Bz2=B2(3,:);
Bz3=B3(3,:);
Bz4=B4(3,:);
Bz5=B5(3,:);
Bz6=B6(3,:);
P1=[R_p*cos(75*deg2rad);R_b*sin(75*deg2rad);0];
P2=[R_p*cos(165*deg2rad);R_b*sin(165*deg2rad);0];
P3=[R_p*cos(195*deg2rad);R_b*sin(195*deg2rad);0];
P4=[R_p*cos(285*deg2rad);R_b*sin(285*deg2rad);0];
P5=[R_p*cos(315*deg2rad);R_b*sin(315*deg2rad);0];
P6=[R_p*cos(405*deg2rad);R_b*sin(405*deg2rad);0];
Px1=P1(1,:);
Px2=P2(1,:);
Px3=P3(1,:);
Px4=P4(1,:);
Px5=P5(1,:);
Px6=P6(1,:);
Py1=P1(2,:);
Py2=P2(2,:);
Py3=P3(2,:);
Py4=P4(2,:);
Py5=P5(2,:);
Py6=P6(2,:);
Pz1=P1(3,:);
Pz2=P2(3,:);
Pz3=P3(3,:);
Pz4=P4(3,:);
Pz5=P5(3,:);
Pz6=P6(3,:);
Y=0;
alpha=0;
gama=0;
L1=(X+((cos(gama)*cos(beta))*Px1)+(((cos(gama)*sin(beta)*sin(alpha))-(sin(gama)*cos(alpha)))*Py1)+(((cos(gama)*sin(beta)*cos(alpha))+(sin(gama)*sin(alpha)))*Pz1)-Bx1)^2+(Y+((sin(gama)*cos(beta))*Px1)+(((sin(gama)*sin(beta)*sin(alpha))+(cos(gama)*cos(alpha)))*Py1)+(((sin(gama)*sin(beta)*cos(alpha))-cos(gama)*sin(alpha)))*Pz1)-By1)^2+(Z+((-sin(beta))*Px1)+((cos(beta)*sin(alpha))*Py1)+((cos(beta)*cos(alpha))*Pz1)-Bz1)^2;
L2=(X+((cos(gama)*cos(beta))*Px2)+(((cos(gama)*sin(beta)*sin(alpha))-(sin(gama)*cos(alpha)))*Py2)+(((cos(gama)*sin(beta)*cos(alpha))+(sin(gama)*sin(alpha)))*Pz2)-Bx2)^2+(Y+((sin(gama)*cos(beta))*Px2)+(((sin(gama)*sin(beta)*sin(alpha))+(cos(gama)*cos(alpha)))*Py2)+(((sin(gama)*sin(beta)*cos(alpha))-cos(gama)*sin(alpha)))*Pz2)-By2)^2+(Z+((-sin(beta))*Px2)+((cos(beta)*sin(alpha))*Py2)+((cos(beta)*cos(alpha))*Pz2)-Bz2)^2;
L3=(X+((cos(gama)*cos(beta))*Px3)+(((cos(gama)*sin(beta)*sin(alpha))-(sin(gama)*cos(alpha)))*Py3)+(((cos(gama)*sin(beta)*cos(alpha))+(sin(gama)*sin(alpha)))*Pz3)-Bx3)^2+(Y+((sin(gama)*cos(beta))*Px3)+(((sin(gama)*sin(beta)*sin(alpha))+(cos(gama)*cos(alpha)))*Py3)+(((sin(gama)*sin(beta)*cos(alpha))-cos(gama)*sin(alpha)))*Pz3)-By3)^2+(Z+((-sin(beta))*Px3)+((cos(beta)*sin(alpha))*Py3)+((cos(beta)*cos(alpha))*Pz3)-Bz3)^2;
A=solve(L1==1,L2==1.1,L3==1.2);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Classical Mechanics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!