Empty sym: 0-by-1
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nick Blom
el 8 de Abr. de 2021
Comentada: Nick Blom
el 9 de Abr. de 2021
This is my code where all values to the right of == are known and it keeps giving me the error saying empty sym: 0-by-1. Does anyone have any ideas why this is error keeps happening.
syms f12x f12y f32x f32y f43x f43y f14x f14y t12
link2x = f12x + f32x == m2*ag2x;
link2y = f12y + f32y == m2*ag2y;
link2T = -(r2/2)*sind(theta2)*f12x + (r2/2)*cosd(theta2)*f12y ...
- (r2/2)*sind(theta2)*f32x + (r2/2)*cosd(theta2)*f32y + t12 == Ig2*aAccel2;
link3x = -f32x + f43x == m3*ag3x;
link3y = -f32y + f43y == m3*ag3y;
link3T = (r3/2)*sind(theta3)*f32x - (r3/2)*cosd(theta3)*f32y - ...
(r3/2)*sind(theta3)*f43x + (r3/2)*cosd(theta3)*f43y == Ig3*aAccel3;
link4x = -f43x + f14x == m4*ag4x;
link4y = -f43y + f14y == m4*ag4y;
link4T = (r4/2)*sind(theta4)*f43x - (r4/2)*cosd(theta4)*f43y - ...
(r4/2)*sind(theta4)*f14x + (r4/2)*cosd(theta4)*f14y == Ig4*aAccel4 - T4;
[f12x,f12y,f32x,f32y,f43x,f43y,f14x,f14y,t12] = solve(link2x,link2y,link2T,...
link3x,link3y,link3T,link4x,link4y,link4T);
0 comentarios
Respuesta aceptada
Walter Roberson
el 8 de Abr. de 2021
There is no solution to those equations.
m2 = rand() * 10;
m3 = rand() * 10;
m4 = rand() * 10;
ag2x = randn() * 10;
ag3x = randn() * 10;
ag4x = randn() * 10;
ag2y = randn() * 10;
ag3y = randn() * 10;
ag4y = randn() * 10;
Ig2 = rand() * 10;
Ig3 = rand() * 10;
Ig4 = rand() * 10;
aAccel2 = randn() * 10;
aAccel3 = randn() * 10;
aAccel4 = randn() * 10;
T4 = rand() * 10;
r2 = rand() * 10;
r3 = rand() * 10;
r4 = rand() * 10;
theta2 = rand() * 360;
theta3 = rand() * 360;
theta4 = rand() * 360;
syms f12x f12y f32x f32y f43x f43y f14x f14y t12
vars = [f12x f12y f32x f32y f43x f43y f14x f14y t12];
link2x = f12x + f32x == m2*ag2x;
link2y = f12y + f32y == m2*ag2y;
link2T = -(r2/2)*sind(theta2)*f12x + (r2/2)*cosd(theta2)*f12y ...
- (r2/2)*sind(theta2)*f32x + (r2/2)*cosd(theta2)*f32y + t12 == Ig2*aAccel2;
link3x = -f32x + f43x == m3*ag3x;
link3y = -f32y + f43y == m3*ag3y;
link3T = (r3/2)*sind(theta3)*f32x - (r3/2)*cosd(theta3)*f32y - ...
(r3/2)*sind(theta3)*f43x + (r3/2)*cosd(theta3)*f43y == Ig3*aAccel3;
link4x = -f43x + f14x == m4*ag4x;
link4y = -f43y + f14y == m4*ag4y;
link4T = (r4/2)*sind(theta4)*f43x - (r4/2)*cosd(theta4)*f43y - ...
(r4/2)*sind(theta4)*f14x + (r4/2)*cosd(theta4)*f14y == Ig4*aAccel4 - T4;
eqn = [link2x,link2y,link2T,link3x,link3y,link3T,link4x,link4y,link4T] .'
[A,B] = equationsToMatrix(eqn, vars)
rank(A)
A\B
3 comentarios
Walter Roberson
el 9 de Abr. de 2021
link3T and link4T are the problems. Both of those can be expressed in terms of the other equations.
Más respuestas (0)
Ver también
Categorías
Más información sobre Function Creation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!