cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Fourier Series on Mathcad

JD_10737621
10-Marble

Fourier Series on Mathcad

Hi guys, so I am having this problem with ploting graphics, I only need to do this simple Fourier Series and plot it, but it doesn't work. I will show the problems with some images and the program itself.

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:JD_10737621)

Before you try to plot a function, you should test the function for a couple of arguments

Werner_E_0-1689382975024.png

You function fails because of a division by zero for any argument you provide!

Reason is this:

Werner_E_1-1689383164349.png

 

The sum should start with i=1 and you have to deal separately with the signal's DC component if necessary.

Werner_E_4-1689383613836.png

 

You may also consider making n a second argument of the function f so you can compare the result of different number of summands

Werner_E_0-1689384832140.png

 

 

View solution in original post

18 REPLIES 18
Werner_E
25-Diamond I
(To:JD_10737621)

Before you try to plot a function, you should test the function for a couple of arguments

Werner_E_0-1689382975024.png

You function fails because of a division by zero for any argument you provide!

Reason is this:

Werner_E_1-1689383164349.png

 

The sum should start with i=1 and you have to deal separately with the signal's DC component if necessary.

Werner_E_4-1689383613836.png

 

You may also consider making n a second argument of the function f so you can compare the result of different number of summands

Werner_E_0-1689384832140.png

 

 

Thanks for the observation, I understood the help note on the software. Think is the professors article was with this exactly expression. So I had no ideia how to solve it, added to it I am still studying this kind of Fourier Series and Solving circuits problems. Last but not least, how can I make the f(t,1), f(t,5) and f(t,100)? I am new at this software.Captura de tela 2023-07-18 221403.png

ttokoro
20-Turquoise
(To:JD_10737621)

image.pngimage.pngi starts from 1 as Werner note it.

ttokoro
20-Turquoise
(To:ttokoro)

f:=1000  means 1kHz. So the T of the function is 1ms. If use f:=1000 then x axis is from 0,0.00001..0.002. 

function f and frequency f are confusing.  So I use Rec(n,t). If you change f:=4 and T:=0.25 you can get the plot.

Attach your Mathcad worksheet, you can get the answer or hints for it.

Werner_E
25-Diamond I
(To:JD_10737621)


. Last but not least, how can I make the f(t,1), f(t,5) and f(t,100)? I am new at this software.

In the pdf in your other answer I see that you already found a solution for plotting more than one trace with the chart component by defining X1 , X3, etc.

If all traces should use the same abscissa values you can make it even simpler by defining X:=t without any subscript. This will then be used for all plot traces as ttokoro just had shown in his picture.

So in you sheet simply delete the index 1 in the definition of X and you should see all four traces.

Hi guys, so this is Joao de Sousa Luz. Once again I thank you guys very much for the help. I want to say again that I still a College Student, and this software is helping me out with some homework. I'm making the graphics and Fourier Series study on how it helps analysis electrical circuits. Still didn't try last ttkoro answers, but I promise to look on it over this week. Right down I use the plot function on Mathcad to use Werne_E first anser and Ttkoro adding simply worked, for the f(t) ploting didn't work. But, when I wright f(n,t) right above it works.

ttokoro
20-Turquoise
(To:JD_10737621)

Infinity series of Ea must calculate + series and - series individually.

See attached Prime 9 file.

ttokoro
20-Turquoise
(To:JD_10737621)

This is the simple Fourier Series probrem of Electrical Engneering.

Electic power by Rectagular voltage and Triangle current.

image.pngimage.pngimage.pngimage.png  

image.pngimage.pngimage.png

image.pngimage.pngimage.png

ttokoro
20-Turquoise
(To:ttokoro)

Half-wave rectification waveform.

image.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.png

Hello ttkoro. This is Joao de Sousa Luz. I see you spent some time doing this reply/answer. Thing is I want to explain these plots in a presentation, so on I have to explain it to colleagues in college. On the other hand I have no time to spend chasing the errors in my plots, I just needed to reproduce what was made at an artcile solicited by the professor. So, after I have done that my work is done, and Werner made it very simply. I downloaded your Mathcad file, and now I see your answer, It is very good, but I don't have time, as I said before to explore more this theme, because I already studied the Fourier Series in Math classes, but I simply forgot, It was like some years ago. So now I would have to revise the issue and then try to understand your solution. I'm from Brazil, if I didn't said it befor. So thing is I have some difficults sometimes to understand some answers you guys try to describe, maybe because of how these structures are teached in Brazil. That's it, help to not make you said with this answer. I'm trying my best to reproduce your answer and trying to understanding of the issue.

 

Att

 

João de Sousa Luz

So this is the article, if you guys have some interest, once more I'm trying to reproduce it for a presentation at college. So It has to be a very simple way to explain to my colleagues and professores what I'm trying to do and explain, etc.

ttokoro
20-Turquoise
(To:ttokoro)

 Full rectified waveforms.

image.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.png

ttokoro
20-Turquoise
(To:ttokoro)

image.pngimage.pngimage.pngimage.png

These three functions have same maximum magnitudes 1. The RMS values are 1/sqrt(1), 1/sqrt(2), and 1/sqrt(3), respectivery.

Find functions which have RMS values 1/sqrt(4) and 1/sqrt(5), respectivery. The fmax are also 1 as same as shown at three plots.

ttokoro
20-Turquoise
(To:ttokoro)

image.pngimage.png

sin(t) function's RMS value is 1/sqrt(2). Find other functions which have same RMS value of 1/sqrt(2). The maximum is also 1. Show the RMS value both from RMS and its Fourier series.

image.pngimage.png

 

ttokoro
20-Turquoise
(To:JD_10737621)

image.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.png

ttokoro
20-Turquoise
(To:ttokoro)

image.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.png

Hello guys, this is Joao de Sousa Luz. First of all, thank you very much for trying help me out. Thing is I could reproduce Werner_E results, altough I still didn't tried to make diferente values such as f(t,1) f(t,5) and f(t,100), but the f(t,1) worked very well. I will try over to this week, but ttkoro answer I couldn't make it, at least your last answer. I will upload my test in mathcad.

Werner_E
25-Diamond I
(To:JD_10737621)

Look at the scaling in ttokoros picture!

The t-values should run from 0 to 1/f = 0.001 to get one period. A low value as he had chosen a higher frequency f.

What the chart component is doing is really bad, though.

I avoid using this chart component for various reasons and rather use the Primes "native" plot feature (as seen in the pics ttokoro and me had posted) even though these plots are missing quite some basic features like grid lines, labels, a secondary y-axis, ...

 

If you must use the Chart component you may consider defining a range for t with the appropriate values in front of the chart component:

Werner_E_3-1689731452589.png

This creates a range which results in the plot traces to consist of 1001 points each.

This should help and you should see a similar plot as the one ttokoro had shown.

To see three periods you simply would change 1/f to 3/f and you may use a larger number than 10^3. Just give it a try.

Defining the range as shown above has the advantage that you can change the frequency back from 1000 to the value 4 which you had used and the plot still will work OK 🙂

 

 

Announcements

Top Tags