Message Boards Message Boards

0
|
5889 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Point-by-Point Multiplication

Posted 11 years ago
I've written a simple loop statement for the Euler equation that goes from zero to four:
k = 1;
A = 5;
n = 5;
Do[F = I*2*Pi*k*i/(A); Print[Exp[-F] // N], {i, 0, n - 1}]
The output is this:
 1.
 
 0.309017 -0.951057 I
 
 -0.809017-0.587785 I
 
 -0.809017+0.587785 I
 
 0.309017 +0.951057 I
I also have a Fourier:
In[35]:= Fourier[{1, 8, 5, 0, 2}, FourierParameters -> {1, 1}]

Out[35]= {16. + 0. I,
0.045085 + 8.64527 I, -5.54508 - 1.22857 I, -5.54508 + 1.22857 I,
0.045085 - 8.64527 I}
How can I write the Fourier inside the loop statement so that Mathematica does point-by-point multiplication?
In essence, I want this to happen inside the loop:
(16.` + 0.` I) (1.)
(0.30901699437494745` - 0.9510565162951535` I) (0.045084971874738144` + 8.645265359233287` I)
(-5.5450849718747355` - 1.228571067720928` I) (-0.8090169943749473` - 0.5877852522924732` I)
(-5.5450849718747355` + 1.228571067720928` I) (-0.8090169943749473` + 0.5877852522924732` I)
(0.30901699437494745` + 0.9510565162951535` I) (0.045084971874738144` - 8.645265359233287` I)
I want the loop to print this as the answer:
16. + 0. I
8.23607 + 2.62866 I
3.7639320225002093` + 4.253254041760198` I
3.76393 - 4.25325 I
8.23607 - 2.62866 I

Thank you in advance.
POSTED BY: sean roubion
Posted 11 years ago
 k = 1;
 A = 5;
 n = 5;
 v = Fourier[{1, 8, 5, 0, 2}, FourierParameters -> {1, 1}];
 Do[F = I*2*Pi*k*i/(A); Print[Exp[-F]*v[[i + 1]] // N], {i, 0, n - 1}]
 
 16. +0. I
 8.23607 +2.62866 I
 3.76393 +4.25325 I
3.76393 -4.25325 I
8.23607 -2.62866 I
POSTED BY: Bill Simpson
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