Sir/Mdm i had a fourier equation need to be evaluate to find THD using matlab code but i am not able to solve this summation using matlab. The required equation which is to be evaluated given below.
and the values of cos angles are
9,20,40,60.
The code i had tried is:
clc;
syms p;
k=symsum(((cosd((2*p-1)*10))/(2*p-1)+(cosd((2*p-1)*22))/(2*p-1)+(cosd((2*p-1)*40))/(2*p-1)+(cosd((2*p-1)*61))/(2*p-1))^2,p,1,50);
j=sqrt(k)/3.14;
double(j)
I am always getting 1 as a solution please help to solve this.

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 3일
편집: Ameer Hamza 2020년 5월 3일

0 개 추천

The solution estimated in your question seems correct. The following shows a numerical solution. Since the series is converging so, I used 100000 terms. You can check that increasing terms have no significant effect on the final sum.
angles = [9, 20, 40, 60];
s1 = @(k) sum(cosd(angles(:).*k(:).'))./k;
s2 = sqrt(sum(s1(3:2:100000).^2));
den = sum(cosd(angles));
result = s2/den;
Result:
result =
0.097311482007934

댓글 수: 8

omkari sai krishna
omkari sai krishna 2020년 5월 3일
Thank you sir for your help. I am also getting the same answer if i tried for 10. I not able to understand where i had done mistake
omkari sai krishna
omkari sai krishna 2020년 5월 3일
i had seen some of the research papers they had given a numeric solution other than 1 .
Ameer Hamza
Ameer Hamza 2020년 5월 3일
They might be using a different equation. This equation seems to be always converging to some value near 1.
omkari sai krishna
omkari sai krishna 2020년 5월 3일
okay sir i will check it. Thank you for your support sir. It really heps me a lot.
Ameer Hamza
Ameer Hamza 2020년 5월 3일
I am glad to be of help.
omkari sai krishna
omkari sai krishna 2020년 5월 3일
sir is my approach of code to this question is right or wrong?
Ameer Hamza
Ameer Hamza 2020년 5월 3일
Please check my updated answer. I found that there was a mistake. Now it gives different values.
You code, also seems correct. Start the sum k limits from 2 instead of 1
clc;
syms p;
k=symsum(((cosd((2*p-1)*10))/(2*p-1)+(cosd((2*p-1)*22))/(2*p-1)+(cosd((2*p-1)*40))/ ...
(2*p-1)+(cosd((2*p-1)*61))/(2*p-1))^2,p,2,50);
%^ use 2 here
j=sqrt(k)/3.14;
double(j)

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2020년 5월 3일

댓글:

2020년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by