Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
I need assistance in writing a matlab code for this iterative example
조회 수: 1 (최근 30일)
이전 댓글 표시
TRYING TO SOLVE FOR u and finding maximum iterations needed to solve
Q1 = [ 25, 10, 15, 20; 10, 12, 18, 23; 12, 15, 17,19 ];
F1 = [ 6;7;12];
F2 = [ 48;64;72];
iter = 0;
N = 100; % maximum number of iterations
uold = u0;
QA = Q1;
F1 = RF1;
F2 = RFM; % max load capacity
u0 = u1;
dF = 0.2;
[row,col] = size(u);
tol = 0.0001;
syms 'u'
R1 = F2 - F1;
u2 = inv(Q1)*R1;
u3 = u0 + u2;
F3 = F1 + dF;
R2 = F2 - F3; % unbalanced force must be equal to 0 in order to converge
Q2 = F3\u3;
u4 = inv(Q2)*R2;
u5 = u3 + u4;
F4 = F3 + dF;
R3 = F2 - F4;
Q3 = F4\u5;
u6 = inv(Q3)*R3;
u7 = u5 + u6;
F5 = F4 + dF;
R4 = F2 - F5;
Q4 = F5\u7;
u8 = inv(Q4)*R4;
u9 = u7 + u8;
F6 = F5 + dF;
R5 = F3 - F6;
댓글 수: 2
John D'Errico
2021년 11월 26일
You do understand that the inverse of a matrix is undefined when the matrix is not square?
Q1 = [ 25, 10, 15, 20; 10, 12, 18, 23; 12, 15, 17,19 ]
size(Q1)
Therefore no number of iterations will suffice, sicne your code will error out almost immediately.
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!