Hello guys,
I have what may seem like a simple problem, but due to my poor knowledge of mathcad I am having great difficulties in getting this right.
My assignment requeires me to make a sort of "generalised solution" to a fourier series. Where a person can put in their own values and all the calculations will be done automatically and it will also plot a graph.
I have almost all of it set up.
But just cant get the summation formula to work at all. It gives completely wrong values and makes no sense to me as to why it does not want to give correct values.
I would be VERY thankful if someone can help me out.
I have attached the worksheet
From the formulas in your file it looks like you try to make a FOURIER series of the following signal
Is this correct?
I doubt that you really need 200 harmonics, don't you?
You may look up the formulas for the Fourier coefficients in your books - you lost the n. Thats the reason all your coefficients have the same value - you may have noticed that. Because of the symmetry of your signal according to the origin you would suppose all a.n being zero. But don't expect this result by evaluating symbolically. You would have to tell Mathcad that n is an integer using assume, but ever so often Mathcad ignores that kind of assumptions. Numeric evaluation should give you the correct results as soon you apply your range variable for n.
In the summation you again did wrong as you wrote a.n+cos(n*x) instead of a.n*cos(n*x) etc.
You sure should check you formulas better.
If you intend to work with Mathcad for a longer time I suggest you look at the help, the getting started, the quicksheets to learn the basics. You have used vectors for amp and A, B, C... but without getting any benefit of doing so. You could have as good used literal indices. Concerning a and b vector indices ar mandatory.
Concerning the generalisation I am not sure what "values" you would let people change at the top.
A nice site about Fourier series which uses Mathcad worksheets is
http://learnweb.getsoft.net/_fouriertest/ger/index2.html
Its in german but you may be able to get some ideas from there.
Hello
I have fixed my formula to change it from plus sign to multiply
I have also changed the variable for 20 harmonics
But instead of 20 answers my Fourier Summation formula gives me more than a thousand
I still cannot understand why it does not work the way I want it to.
What you showed in the picture is exactly my fourier sinewave.
But I need the summation formula to work correctly to produce that wave.
Can you please help?
I have fixed my formula to change it from plus sign to multiply
Have you added the n at the argument of sin and cos in an, bn? You also missed tghe factor 1/pi at a0.
But instead of 20 answers my Fourier Summation formula gives me more than a thousand
this is because you did not assign that sum to a function name (fFour(x):=......) but rather evaluated it. As you had defined x as a range variable before Mathcad is iterating over that values and x has alot of values 😉
See if the attached helps
May by this will be interesting and helpfull for you:
on line calculation http://twtmas.mpei.ac.ru/mas/Worksheets/Fourier.mcd
and animation http://communities.ptc.com/videos/1416