next up previous
Next: About this document ... Up: Math 0250 Computer Assignment Previous: Getting started

Stuff to write up

Here's some stuff for you to write up and turn in.
1.
Many elementary math books tell you that you can't take the log of a negative number. Ask the computer to for the log of -1. Report the result, and explain how it came up with that answer.
2.
You're surely familiar with the identity

\begin{displaymath}
\log(e^a) = a\end{displaymath}

right? That means if you let b = ea, then $\log b$ should be a. Ok, give it a try. Enter
  a = 10i
  b = exp(a)
  log(b)
Did you get what you expected? Explain the discrepancy.
3.
Let's try to get a feel for what it means to take an exponential of an imaginary number. Make a list of numbers between 0 and 6.3 with
  T = 0:0.1:6.3;
Now multiply each list entry by i, and exponentiate the results:
  Z = exp(i*T);
Now plot these points with
  plot(Z,'.')
That strange looking second argument to the plot command tells the computer to just plot the points, and not to connect the dots. Report what you see, and explain why the points came out arranged this way.
4.
If you haven't already done so, enter the code from item 3. Then enter
  abs(Z)
Report the result, and explain why you got what you did. How is this related to what you got in 3?

5.
Here are a bunch of complex numbers arranged around a circle of radius 2:
  T = 0:0.1:2*pi;
  Z = 2 * cos(T) + 2 * sin(T) * i;
  plot(Z,'.')
Here are their logarithms:
  W = log(Z)
  plot(W,'.')
Report the results and explain why it came out this way.

6.
In the our work with differential equations, we'll often deal with complex valued functions of the form

\begin{displaymath}
F(t) = A e^{i\omega t}.\end{displaymath}

The parameter A is the (complex) amplitude, and $\omega/2\pi$ is the frequency. (Here $\omega$ is assumed to be real and positive.) The real and imaginary parts of F(t) are both sinusoidal. Let's pick numerical values for A and $\omega$ out of the air, and have a look at the real and imaginary parts of F plotted together.
  A = 3 - 4i;
  w = 2*pi;
  T = 0:0.05:3;
  F = A * exp(i*w*T);
  plot(T,[real(F);imag(F)])
Now have a look at the output of the following:
  theta = angle(A);
  m = abs(A);
  f = m * cos(w*T + theta);
  plot(T,f)
The result should look a lot like one of the two curves in the previous plot. Let's plot this new function on the same axes as the real part of F:
  plot(T,[F;f])
They should plot out right on top of each other! In other words, the real part of the complex oscillation F is a cosine wave whose amplitude is exactly the absolute value of the complex amplitude of F, and with a phase shift of $-\arg(A)$:

\begin{displaymath}
\hbox{Re} F(t) = \vert A\vert \cos(\omega t + \arg(A))\end{displaymath}

Convince me that this isn't a fluke, ie, that the above formula always holds, no matter what you plug in for A and $\omega$.

7.
In 6, you showed that the real part of a complex oscillation is a cosine wave. Here you'll reverse the procedure. Convince me that a function of the form

\begin{displaymath}
f(t) = a \cos(\omega t) + b \sin(\omega t)\end{displaymath}

with a and b real can always be realized as the real part of

\begin{displaymath}
F(t) = A e^{i\omega t}\end{displaymath}

with A=a-bi. Use this to calculate the amplitude and phase shift for the function $f(t)=\cos t - 2 \sin t$. (Here phase shift means an angle $\phi$ such that $f(t) = c \cos(\omega t-\phi)$.

next up previous
Next: About this document ... Up: Math 0250 Computer Assignment Previous: Getting started
Frank Beatrous
1/8/1998