Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more!
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Mar 01, 2021
05:46 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 01, 2021
05:46 PM

Plot of complex numbers and symbolic engine not working

Hi all,

I am trying to plot the amplitude spectra( or Fourier transform) of a one cycle sine wave

i.e sin(t)*u(t)-u(t-2*pi), where u(t) represents a Heaviside function.

1-I found the Fourier transform of this using integration. However, when f(t) * e^..... is put in the symbolic arrow does not give any answer and merely states the same. When sin(t)*e^-1i*w*t is integrated the symbolic gives the correct answer but why does it not work when f(t) is used.

2-Second problem, I want to plot this fairly simple function. The problem is mathcad is saying the real part is around 0.075 according to the graph. It should be 0,0. The imaginary part should be 0,-3.141... however mathcad is plotting 1,-3.141.... What is going on?

The file is attached. Prime 6 was used

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Mar 02, 2021
02:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 02, 2021
02:38 AM

The plot is correct, but the scaling which was automatically chosen by Prime is ... unfavorable, to keep it polite.

If you look closely you see that the point is right between -0.15 and +0.15, so its correctly at zero. The short vertical line you see from the point to the x.axis is drawn, because you had chosen a "Stem plot" as plot type for the real part instead of a normal "Line Trace".

Because of the scale chosen by Prime the axis in your plot don't cross at (0,0) even though the appropriate button is pressed. You can move the axis with the mouse, but it will only snap to an axis tick.

You have to manually change the scaling - its not obvious but you can edit the first, second and last value at each axis (the values highlighted in yellow in the picture below).

Primes plotting abilities are far away from being state of the art and the 3D-plots are even worse.

BTW, you may consider making w an additional argument of function f and use F(1) instead of defining w:=1 for the whole rest of the sheet.

7 REPLIES 7

Mar 01, 2021
05:55 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 01, 2021
05:55 PM

Delete the definition of w:=1 at the top of the sheet and see if things are working as you expect.

BTW, you can use an omega instead of just w by typing w followed by Ctrl-g

Mar 01, 2021
06:09 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 01, 2021
06:09 PM

Hi,

I tried that but it doesn't work. It does give the correct symbolic result but now the graph is wrong. And when I do w:1 , the previously mentioned problem occurs.

Mar 01, 2021
06:50 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 01, 2021
06:50 PM

When the symbolic result is correct, why do you think that the graph is wrong?

The real part is constant zero and the imaginary part is the hyperbola -pi/w

F(1)=0-3.14 *j

Mar 01, 2021
07:15 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 01, 2021
07:15 PM

Oh no, that graph is correct. What I meant to say is that that when I make w=1 to plot F(1), I don't think it is plotting the correct result. Instead, it plots something like F(1)= (1,-3.14) and (1,0.075). I have no idea what the latter part is. Where is the real part coming from?

I think F(1) is correct because w is 1 so w axis value would be one. I dunno what the Re(F(1)) is?

Mar 02, 2021
02:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 02, 2021
02:38 AM

The plot is correct, but the scaling which was automatically chosen by Prime is ... unfavorable, to keep it polite.

If you look closely you see that the point is right between -0.15 and +0.15, so its correctly at zero. The short vertical line you see from the point to the x.axis is drawn, because you had chosen a "Stem plot" as plot type for the real part instead of a normal "Line Trace".

Because of the scale chosen by Prime the axis in your plot don't cross at (0,0) even though the appropriate button is pressed. You can move the axis with the mouse, but it will only snap to an axis tick.

You have to manually change the scaling - its not obvious but you can edit the first, second and last value at each axis (the values highlighted in yellow in the picture below).

Primes plotting abilities are far away from being state of the art and the 3D-plots are even worse.

BTW, you may consider making w an additional argument of function f and use F(1) instead of defining w:=1 for the whole rest of the sheet.

Mar 02, 2021
06:25 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 02, 2021
06:25 AM

Thanks again, I don't understand why I didn't see that before. The real part was zero all along! I've changed the y axis now and its all sorted.

The stem trace is normally used by my lecturer when harmonics or amplitude spectra is plotted but I might start using the line trace.

I was working late at night yesterday so, might have missed it. Anyway, the time displayed in these forums is very different to where I live. My time is 4 hours ahead of this forums time.

Mar 02, 2021
06:50 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Mar 02, 2021
06:50 AM

For plotting a spectra a stem plot sure is appropriate.