Hello, I want to convert summation of below problem into matlab code

조회 수: 1 (최근 30일)
Akshay Mallikarjun Puttallavar
Akshay Mallikarjun Puttallavar 2019년 8월 29일
편집: Sai Sri Pathuri 2019년 9월 3일
This is the expanded value of H33
H33=[(U(1,3)*U(1,3))]./[(w(1,1).^2-w.^2)]+[(U(2,3)*U(2,3))]./[(w(2,2).^2-w.^2)]+[(U(3,3)*U(3,3))]./[(w(3,3).^2-w.^2)]+[(U(4,3)*U(4,3))]./[(w(4,4).^2-w.^2)]+[(U(5,3)*U(5,3))]./[(w(5,5).^2-w.^2)]+[(U(6,3)*U(6,3))]./[(w(6,6).^2-w.^2)];
H34=[(U(1,3)*U(1,4))]./[(w(1,1).^2-w.^2)]+[(U(2,3)*U(2,4))]./[(w(2,2).^2-w.^2)]+[(U(3,3)*U(3,4))]./[(w(3,3).^2-w.^2)]+[(U(4,3)*U(4,4))]./[(w(4,4).^2-w.^2)]+[(U(5,3)*U(5,4))]./[(w(5,5).^2-w.^2)]+[(U(6,3)*U(6,4))]./[(w(6,6).^2-w.^2)];
H35=[(U(1,5)*U(1,3))]./[(w(1,1).^2-w.^2)]+[(U(2,5)*U(2,3))]./[(w(2,2).^2-w.^2)]+[(U(3,5)*U(3,3))]./[(w(3,3).^2-w.^2)]+[(U(4,5)*U(4,3))]./[(w(4,4).^2-w.^2)]+[(U(5,5)*U(5,3))]./[(w(5,5).^2-w.^2)]+[(U(6,5)*U(6,3))]./[(w(6,6).^2-w.^2)];
I tried writing it as
S1=0;
for r=(1:6)
S1=S1+[sum(U(r,3)*U(r,3))]/[sum(w(1,r).^2-w.^2)];
end
S2=0;
for r=(1:6)
S2=S2+[sum(U(r,3)*U(r,4))]/[sum(w(1,r).^2-w.^2)];
end
S3=0;
for r=(1:6)
S3=S3+[sum(U(r,5)*U(r,3))]/[sum(w(1,r).^2-w.^2)];
end
z2=S1+(ay3*S2)-(ax3*S3);
Is this correct?
  댓글 수: 2
dpb
dpb 2019년 8월 29일
편집: dpb 2019년 8월 29일
Dunno...breaks my eyes to try to look at. Do you get same answers?
Akshay Mallikarjun Puttallavar
Akshay Mallikarjun Puttallavar 2019년 8월 29일
In simple it is,
Hij= (Summation r=1:6) [(U(i,r)*U(j,r))/(wr^2-w^2)]

댓글을 달려면 로그인하십시오.

답변 (1개)

Sai Sri Pathuri
Sai Sri Pathuri 2019년 9월 3일
편집: Sai Sri Pathuri 2019년 9월 3일
There is no need of summation in the expressions of S1, S2 and S3. Try using the following equations.
S1=S1+[U(r,3)*U(r,3)]./[w(r,r).^2-w.^2];
S2=S2+[U(r,3)*U(r,4)]./[w(r,r).^2-w.^2];
S3=S3+[U(r,3)*U(r,5)]./[w(r,r).^2-w.^2];

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by