Plotting the complex exp function in Maple?

In summary, the user is asking how to plot a function in Maple, and they are not sure if they need to add more code to get it to display properly. They suggest plotting the real and imaginary parts of a complex exp function alongside each other on a 2D plot.
  • #1
Susanne217
317
0

Homework Statement



If we have [tex]y(x) = e^{i\cdot x}[/tex] where [tex]x\in [0,\pi][/tex]

How do I plot function in Maple? So it shows anything?


The Attempt at a Solution


if I write

Code:
plot(exp(I*x),x=0..Pi);

I get an empty coordinate system. Do I need to add some more code to get it to display properly?

Sincerely
Susanne

p.s. I know [tex]e^{i\cdot t} = cos(t) + i \cdot sin(t)[/tex]
 
Last edited:
Physics news on Phys.org
  • #2
what do you hope to see - note if you're trying to do a 2D plot have you thought through how you can even plot a complex function?

a 2D plot is generally a scalar function of a single variable

it might be better to plot the magnitude and phase or the real and imaginary parts which are each scalars so can be plotted in 2D against x
 
  • #3
lanedance said:
what do you hope to see - note if you're trying to do a 2D plot have you thought through how you can even plot a complex function?

a 2D plot is generally a scalar function of a single variable

it might be better to plot the magnitude and phase or the real and imaginary parts which are each scalars so can be plotted in 2D against x

So what I do here is that I take the real part of complex exp function and plot it along the x-axis and imaginary part along the y-axis?

where cos(t) is real part and i*sin(t) the img part.

EDIT: I plot the real part cos(t) along the interval zero to Pi that gives the real Cosine function while the imaginary part along the same interval i*sin(t) me nothing.

Can that be right? because i*sin(0) = 0 and i*sin(Pi) =0.

So all in the plot of complex exp function along the interval [0,Pi] is simply the real cosine function?
 
Last edited:
  • #4
you have to decide what you want to plot... i can't tell you what it is you want to do...

but...if you have a complex number z = a + ib, then a & b are both scalars, a is the real part, & b is the imaginary part.

hence why you can't plot isin(x), that is still a complex number, to plot the imaginary part you just plot sin(t).

if you want x to vary in the interval and plot the real part of [itex] e^{ix} [/itex] along the y axis, and the imaginary part along the z axis. Then parametrically you would plot
[tex] x(t) = t[/tex]
[tex] y(t) = cos(t)[/tex]
[tex] z(t) = sin(t)[/tex]

and the curve will look like part of a spiral with its central axis along the x axis
 
  • #5
lanedance said:
you have to decide what you want to plot... i can't tell you what it is you want to do...

but...if you have a complex number z = a + ib, then a & b are both scalars, a is the real part, & b is the imaginary part.

hence why you can't plot isin(x), that is still a complex number, to plot the imaginary part you just plot sin(t).

if you want x to vary in the interval and plot the real part of [itex] e^{ix} [/itex] along the y axis, and the imaginary part along the z axis. Then parametrically you would plot
[tex] x(t) = t[/tex]
[tex] y(t) = cos(t)[/tex]
[tex] z(t) = sin(t)[/tex]

and the curve will look like part of a spiral with its central axis along the x axis

I may have a whole in my knowledge so please excuse me :) But the reason that I only need to plot the the scalars a and b of z= cos(t) + i*sin(t) is its impossible to view i*sin(t) as a point by itself graphically?

Why must I do a 3D plot? Can't I do a 2D plot?
 
  • #6
once again you can do whatever you want, you just have to decide - you could plot both the real and imaginary part of the function as 2 separate curves in 2D... on the same graph even

you can't plot i.sin(t) as its a complex number, you can decide an axis will represent the imaginary part of a complex number, but the plot command you give will be a scalar function

you can plot any scalar function, as said, examples of scalar function of a compelx variable are:
- real part
- imaginary part
- magnitude
- phase (arg)
 
  • #7
lanedance said:
once again you can do whatever you want, you just have to decide - you could plot both the real and imaginary part of the function as 2 separate curves in 2D... on the same graph even

you can't plot i.sin(t) as its a complex number, you can decide an axis will represent the imaginary part of a complex number, but the plot command you give will be a scalar function

you can plot any scalar function, as said, examples of scalar function of a compelx variable are:
- real part
- imaginary part
- magnitude
- phase (arg)

I thought of something Lanedance.

Since modulus for [tex]e^{it}[/tex] where [tex]0 \leq t \leq 2\pi[/tex] is one..

Then can't a plot of exp(it) as show in my file attachment. Don't know howto show something simular in Maple...
 

Attachments

  • complex_exp.jpg
    complex_exp.jpg
    6.4 KB · Views: 731

Related to Plotting the complex exp function in Maple?

1. How do I plot the complex exp function in Maple?

To plot the complex exp function in Maple, you can use the command plot(exp(x+I*y), x = xmin..xmax, y = ymin..ymax) where xmin, xmax, ymin, and ymax are the desired ranges for the real and imaginary parts of the function.

2. Can I plot the magnitude and phase of the complex exp function separately?

Yes, you can plot the magnitude and phase of the complex exp function separately by using the commands plot(abs(exp(x+I*y)), x = xmin..xmax, y = ymin..ymax) for the magnitude and plot(argument(exp(x+I*y)), x = xmin..xmax, y = ymin..ymax) for the phase.

3. How do I change the color and style of the plot?

You can change the color and style of the plot by adding additional arguments to the plot command. For example, plot(exp(x+I*y), x = xmin..xmax, y = ymin..ymax, color = red, linestyle = dot) will plot the function in red with a dotted line style.

4. Can I add labels and a legend to the plot?

Yes, you can add labels and a legend to the plot by using the label and legend arguments in the plot command. For example, plot(exp(x+I*y), x = xmin..xmax, y = ymin..ymax, label = "exp(x+iy)", legend = "Function") will add a label to the plot and a legend with the specified text.

5. Is it possible to plot multiple complex exp functions on the same graph?

Yes, you can plot multiple complex exp functions on the same graph by using the plots:-display command. For example, plots:-display(plot(exp(x+I*y), x = xmin..xmax, y = ymin..ymax), plot(exp(2*x+I*y), x = xmin..xmax, y = ymin..ymax)) will display both functions on the same graph.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
645
  • Calculus and Beyond Homework Help
Replies
7
Views
916
  • Calculus and Beyond Homework Help
Replies
9
Views
185
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
504
  • Calculus and Beyond Homework Help
Replies
3
Views
577
  • Calculus and Beyond Homework Help
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
701
  • Calculus and Beyond Homework Help
Replies
10
Views
2K
Back
Top