There are all sorts of resonances around us, in the world, in our culture, and in our technology. A tidal resonance causes the 55 foot tides in the Bay of Fundy. Mechanical and acoustical resonances and their control are at the center of practically every musical instrument that ever existed. Even our voices and speech are based on controlling the resonances in our throat and mouth. Technology is also a heavy user of resonance. All clocks, radios, televisions, and gps navigating systems use electronic resonators at their very core. Doctors use magnetic resonance imaging or MRI to sense the resonances in atomic nuclei to map the insides of their patients. In spite of the great diversity of resonators, they all share many common properties. In this blog, we will delve into their various aspects. It is hoped that this will serve both the students and professionals who would like to understand more about resonators. I hope all will enjoy the animations.

For a list of all topics discussed, scroll down to the very bottom of the blog, or click here.

Origins of Newton's laws of motion

Non-mathematical introduction to relativity

Three types of waves: traveling waves, standing waves and rotating waves new

History of mechanical clocks with animations
Understanding a mechanical clock with animations
includes pendulum, balance wheel, and quartz clocks

Water waves, Fourier analysis



Showing posts with label animation of sine function creation. Show all posts
Showing posts with label animation of sine function creation. Show all posts

Monday, January 21, 2008

Superposition and standing waves

The animation below shows two types of waves: transverse waves on a rope and longitudinal compression (i.e. very slow acoustical) waves propagating through a line of squishy balls full of water. The compression waves are made clearer by having the color of each ball change in response to the compression of the ball, to red as a ball is compressed and to blue as it is stretched. To see the animation, mouse over it. To stop it, mouse off it. To restart it, click on it.

As the animation first opens (with only the pulse option clicked on... having a red square), it shows two short bursts of traveling waves being launched from the two ends of each wave system. At first, these bursts separately travel towards each other. At some point, they overlap and cause a complicated interference pattern. Then once they are through each other, they resume their simple sinusoidal shape and travel to the end where they are absorbed. During the interference time, we see a brief glimpse of the standing waves we will be discussing below.

If we click on "phasors" we see a phasor diagram in each of the balls, showing the "state of the wave" at each point along the medium. Just to remind you, a phasor is a vectorial diagram showing the amplitude and phase of a sinusoidal wave at a particular point. The phasor in a particular ball is correct, both for the longitudinal wave going through that ball and for the transverse wave in the rope directly above the ball. The phasor diagrams normally would be drawn so they are stationary, but we took artistic liberties on this, having them move back and forth with each ball. They also compress and stretch with the balls.

We can use the animation to understand the phasors and the waves they represent in three regions:

  • In the non-interfering part of the wave, i.e. inside the pure traveling wave part, we see that the amplitudes (magnitude or length of the vectors) are constant, while the phases (the angles of the phasors) are continually changing, i.e. the phasors constantly rotate in a counter-clockwise direction.
  • Where there is no wave, the magnitudes are zero. The angles, i.e. phases, are indeterminate since the vectors have zero lengths.
  • In the interference zone, the phasors have different magnitudes at the different points and they also still rotate.

If we click "components" we now see extra red and blue ropes once the waves are launched. Note that in the sections with no waves, all three colored ropes are bunched together and hard to distinguish. The red rope shows only the wave launched from the left, while the blue one shows the wave launched from the right. The black rope shows the sum of the two waves. That is, at each point in the horizontal direction, if we sum (for a particular x value) the deflections of the red and blue ropes, we will get the deflection of the black rope. This is the principle of superposition, that in a linear system, such as these, when two waves travel through each other, the response of the medium is just to add the deflections of the two waves at each point. We also see that in the interference region, the phasors now show red and blue vectors in addition to the black one. Note that in each ball, the black vector is the vector sum of the red and blue vectors. Note also that the red phasor is the correct phasor for the red rope's wave, and the blue one is correct for the blue wave. Because the red phasor is in front of the blue one which is in front of the black one, the red tip is made a little smaller than the blue tip which is smaller than the black tip to allow you to see a little of all of them when they are together. At the same time, they are very small and it takes sharp eyes to distinguish them in this case. For example, you will have to look very closely to see the red and blue phasors in the interference region at the very center where all three vectors are aligned.

    Animation showing the process of superposition of two traveling waves to make a standing wave

If we click the "continuous" button, a continuous sinusoidal wave will be launched from the two ends (this may take a bit of time to get started). At first, we see two waves traveling towards each other and interfering. In time, the interference zone takes over the whole space. When this happens, we have what is called a standing wave on the black rope. A standing wave results from the superposition of two traveling waves. You can probably see the standing wave best by unclicking the "components", i.e. just click on "components" again to turn off its red indicator.

  • A standing wave has a different appearance from a traveling wave.
    • A traveling wave keeps its shape and appears to slide along (focus on just the red wave to see the "sliding" of a pure traveling wave).
    • A standing wave, the black wave, oscillates in place and appears stationary.
  • A standing wave has "nodes", places where the wave amplitude is zero, pointed out on the animation above by the stationary black arrows.
  • It also has "anti-nodes" half way between the nodes where the wave oscillates at its maximum amplitude.
  • This author prefer the terms "zeroes" and "maxima" instead of nodes and anti-nodes.

Looking at the waves on the rope, we can understand the mechanics of the standing wave formation. The red and blue traveling wave, propagate to the right and left, respectively (click again on "components" to see this and focus on the red or blue wave). The zeroes (nodes) are located at points where the red and blue waves are mirror images of each other and cancel, producing zero sums at these locations. We see in the phasors, below the zeroes, that the red and blue vectors (or phasors) are pointing in opposite directions (180° apart) and the black sum vector is zero, and therefore not visible.

The maximums (anti-nodes) occur where the two traveling waves equal each other. When the red wave is maximum, the blue wave is also maximum at these points. It is rather fascinating to center your attention on a maximum and watch the red and blue waves slide in a symmetrical way towards this point from opposite directions. A look at the phasors below these point reveals red and blue vectors pointing in the same direction, which is also the direction of their sum, the black phasor. As pointed out before, when the vectors are aligned it takes a sharp eye to distinguish the individual vectors. At these maximums (anit-nodes), the red and blue waves are "in phase" with each other, have 0° phase difference, and add in a maximal way.

At other points besides the zeroes and maximums, the phase shift is somewhere between 0° and 180°. At these points, you can see all three vectors: the red, blue, and black (sum) ones. Note that the phasors in all the balls rotate counterclockwise. Also note that the black, sum phasors, all are pointing in the same, or in exact opposite, directions at any point in time (mouse off the animation to freeze the motion). On the other hand, the traveling waves (such as the red or blue waves) have phasors that vary in direction along the length of the wave.

Math of standing waves done with cosines

The cosine equations for transverse traveling waves propagating in the positive and negative directions are

    .

The similar equations for the pressure in longitudinal compression (acoustical) waves are

    .

A standing wave is a superposition of two equal traveling waves, propagating in opposite directions and is given by the sum of the two above waves:

.

The above is correct for transverse waves. For the compression wave, the equation is practically the same:

.

By using the cosine equation,

,

we can change these sum formulas into

.

The right most part can be rewritten with emphasize on the relevant terms as

.

Thus we see that the basic x sinusoid, cos κx, is multiplied by the time varying function 2A cos ωt. By the process of adding two shifting, traveling waves together, by interfering them, we no longer have a shifting function f(ωt ± κx), and instead have a stationary cosine whose amplitude cyclically varies with time. This is just what the animation above shows. When we have a fully developed standing wave, the magnitudes or lengths of the phasors vary in proportion to cos κx.

Almost as if by magic, two oppositely moving traveling waves interfere to produce a quite different, standing wave.

Math of standing waves with complex phasors

Complex phasors can be used to simplify the above math. We do that here, repeating the above work using complex notation for the waves.

The sum of the two oppositely moving traveling waves is

.

In contract to cosines, exponentials are easy to factor using

.

Thus our complex superposition equation becomes

.

This can be further reduced with the equation

,

which is easy to derive from Euler's formula. Using this gives

.

Just as in the cosine derivation, we end up with the conclusion that the sinusoid, cos κx, is multiplied by the time varying function 2A exp iωt. Of course there is the implied "real part of" associated with complex phasors. If we take the real part of the last equation, we get:

which is the same as the result in the cosine derivation.

If we hadn't explained all the steps, our derivation would have looked like:

.

The animations in this posting can be downloaded free from George Mason University Archival Repository. Please read the fair use policy for this work.
© P. Ceperley, 2008.


NEXT: Complex phasor representation of a standing wave PREVIOUS TOPIC: Types of waves (2D waves, EM waves, longitudinal waves)
Good references on WAVES Good general references on resonators, waves, and fields
Scroll down farther for a list of the various related topics covered in postings on this blog.

Tuesday, October 30, 2007

Euler's Formula and Complex Numbers


Scientists who deal with oscillations and waves make extensive use complex numbers.


But just what are complex numbers and why use them?

The short answer:

Complex numbers are an invention of the handful of mathematicians in the 16th through 19th centuries. Perhaps the best known for his contribution to the development of complex numbers is Leonhard Euler. He used i, an "imaginary number" to allow him to create a relationship between two quantities that one would normally not guess to be related to each other. While "Euler's formula", (published in 1748) created interest in the mathematical community, its utility for the world at large was questionable.

By the middle and late 1800, technology associated with oscillations and waves was emerging with inventions of AC power, the telephone, and the wireless telegraph. One of the problems to be overcome was the difficulty in calculating the various design quantities associated with oscillations and waves. Engineers and scientist discovered that by using complex numbers in a rather artificial way, they were able to greatly simplify calculations.

Today, all electrical engineers and physicists are well versed in these methods and complex math is used everyday in the design of most electronics and communication devices and systems, as well as in science in general.

presenting waves presenting waves

The long answer

A brief history of complex numbers

If you study trigonometry, you will be familiar with sines and cosines. Their use proved essential to navigation of the great sailing ships and today are used in countless technological computations. Their use was first documented by the Greek Hiipparchus in 140BC. They basically give you the ratio of lengths of a right triangle based on the angle involved. To be more specific, using the triangle shown below:

right triangle used to define sine and cosine functions Hipparchos of ancient Greece

the cosine is defined as

Definition or cosine,

where φ is the lower case greek letter "phi". To put the above equations in words: the cosine is the ratio of the non-hypotenuse side next to the angle over the hypotenuse of that right triangle. The sine is a similar trigonometric function which uses the other side:

definition of sine

In text, one usually writes out "sine" and "cosine" while in an equation, we use the abbreviations "sin" and "cos" instead.

In dealing with oscillations and waves, we often consider the sine and cosine more as functions than geometric ratios. Below is an animation which shows the production of a graph of a sine function, based on the triangle above.

The above animation varies the angle of the triangle and plots the length of the side opposite the angle, as is appropriate for the sine function. That side is the height of the triangle or y. The length of the hypotenuse is assumed to be fixed at 1, so it can be ignored, i.e. sin θ = y/r = y/1 = y , if r = 1.

You will need flash on your computer to view this animation. Click on the buttons to activate the animation. Press − in the +/− button to hid the cartoon features of this animation and + to restore them.

A cosine graph could be made in similar fashion, however one would need to plot x or the width of the triangle instead of its height. The graph of the cosine function is shown below plotted against angle in both degrees and radians.

graph of cosine as a function of angle in degrees cosine as a function of angle in radians, expressed as a decimal number

cosine as a function of angle expressed in fractions of π radians graph of sine as a function of angle expressed in decimal radians

Above the cosine function plotted against its argument, i.e. the angle. In the first graph, the angle is expressed in degrees. In the second graph, it is in radian. In the third graph, it is also in radians, but here it is expressed in fractions of π radians.

In working with oscillations and waves we usually express the argument in radian. Radians are just an alternate way to measure angle. Instead of 360 degrees being all the way around a circle, in radians, it is 2 π radians or 6.28 radians is a complete circle. Because a complete circle is exactly 2 times π radians, often the angles are expressed in fractions of π as an alternate to expression the angle in decimal radians. We show both forms, both decimal radians and fractions of π above (see the numbers and labeling on the x axes.

To convert from degrees to radians multiply by π/180 or by 0.0175 . Alternately, divide by 57.30 . To convert from radians to degrees multiply by 180/π or 57.30 .

The last graph, with the red curve, is a graph of the sine function (as opposed to the cosine function) similar to that generated by the above animation, but plotted versus decimal radians instead of versus degrees. Note that the sine function is basically the same shape as the cosine function, but shifted over a little in the x axis. Actually it is shifted over exactly 90 degrees or π/2 radians.


Using calculus methods, one can show that we can use infinite series as an alternate way to express functions such as cosine and sine. The correct expressions for these are: infinite series expansion of cosine infinite series expansion of sine

We have used the variable x instead of the ϕ used above (we are always free to change variables in equations, if we replace one variable with another throughout the equation). The x we use here is not the same as the x coordinate used above with the right triangle. As it is with the English language, in math, an algebraic symbol can mean different things at different times.

There is also a similar infinite series expression for e raised to a variable power x. The constant e is the base of the natural logarithms and equals 2.71828... . We show a plot of this function and its infinite series expansion below.

graph of the exponential function

infinite series expansion of the exponential function.

A relationship between sines, cosines, and ex.

image of Leonhard Euler

Leonhard Euler, 1707-1783, one of the great mathematicians.

Wikipedia

In 1748 Leonhard Euler was fascinated by the similarity of these last three formulas. Indeed, at first glance it would appear that the combination of the first two formulas would contain all the exact terms of the exponential formula (the last formula). But how can that be? How can equations for trigonometry from right triangles, be at all related to exponentials that have to do with logarithms? They are usually considered totally separate and unrelated areas in mathematics. However, using the formulas we can try to relate them. It certainly looks intriguing. Plunging ahead, we find that if you simply add the first two formulas, you get:

infinite series sum of sine plus cosine,

which has the wrong signs between many of the terms, preventing it from exactly equaling ex. What is needed? These two formulas seem too close to be ignored. There must be some fundamental relationship between the trigonometric formulas and the exponential formula!

We need some way of making the signs (the pluses and minuses, not the sines and cosines) in the terms of the last formula to alternate every second term. A normal trick for adjusting signs is to insert a −x in place of the x in ex. This gives:

infinite series for exp(−x).

Simplifying this yields:

reduced infinite series of exp(−x).

This, however produces alternating signs every term, so it isn't quite right. Euler reasoned that he needed something with half the strength of a minus sign (or the −1) so when it was squared it would equal a minus sign. In desperation, he used a quantity i defined as:

the magic of the complex constant i

mathematical definition of the complex constant i.

This means that

i squared = −1,

where the ≡ stands for "defined as equal to". Euler knew this was ridiculous. Square any number (multiply it by itself) and you always get a positive number, even if the starting number is negative. So a real number with the needed properties didn't exist. Not wishing to give up so easily, he simply declared i to be "imaginary", because it only existed in his imagination, but he was going to use it anyway. Continuing, if we replace x with ix everywhere in the exponential equation, we get:

infinite series expression for exp(ix),

which using the definition of i can be simplified to:

reduce expression for exp(ix).

We're almost there! That is, we have all the signs correct to have an exponential expression equal to the sum of the sine and cosine expression. The remaining problem is that all the terms that are associated with the sine expansion seem to have an extra i in front of them. Euler fixed that up by saying that this expression for the exponential is equal to cos x + i sin x. That is, he wrote:

the famous Euler's formula

This is the famous Euler's formula and is often considered to be the basis of the complex number system. In deriving this formula, Euler established a relationship between the trigonometric functions, sine and cosine, and e raised to a power. It wasn't for many years that the true power of the relationship was revealed.


Next: More details on infinite series.
Next: the technology of oscillations and waves demands new mathematical methods.

© P. Ceperley, 2007.


Good references on WAVES Good general references on resonators, waves, and fields
Scroll down farther for a list of the various related topics covered in postings on this blog.