Message Boards Message Boards

0
|
4634 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Plot a Function with Sum

Posted 9 years ago

Hi all, I have to plot this simple rectangular curve.

NN = 100; tlc = 2*Pi/36; NI = 1000; r3 = 40*10^(-3);
an2[n_] := 
 NI*(1 - Exp[I*n*Pi])*(Exp[I*n*tlc*(1/2)] - Exp[-I*n*tlc*(1/2)])/(tlc*
     r3*(2*I)*n*Pi)
Plot[
 Evaluate[Sum[an2[n]*Exp[-I*n*theta], {n, -NN, -1, 1}] + 
   Sum[an2[n]*Exp[-I*n*theta], {n, 1, NN, 1}]], {theta, 0, 2*Pi}]

I do not get a rectangular signal but another one. Can any one help Thank you

POSTED BY: Boughrara Kamel
5 Replies

Dear Henrik, Thank you, now the plot is nice. Best regards Kamel

POSTED BY: Boughrara Kamel

Hi Boughrara,

you are plotting a function which is complex valued, so I was wondering why one sees a plot at all! Anyway, I think all you need to do is to make sure you see your complete plot; for this you need to plot it like so:

Plot[ ... you function ..., {n,1, NN}, PlotRange -> All]

Regards -- Henrik

POSTED BY: Henrik Schachner
POSTED BY: Marco Thiel

Thank you for your answer. In the attached file, you can find the code. I want to plot this Fourier series expansion of a periodic rectangular signal (with plot like in the commands I do). I do not know why I can not obtain my signal. I do it with an other softwar and I attached the curve in the attached code. Thank you again.

Attachments:
POSTED BY: Boughrara Kamel

The answers are only for difficult questions !?

POSTED BY: Boughrara Kamel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract