Showing posts with label Mathematics Specialist 3AB. Show all posts
Showing posts with label Mathematics Specialist 3AB. Show all posts

Friday, April 5, 2013

Complex Numbers and Polar Coordinates

(This post was cut and pasted from one of my other blogs.)


So... I have this Maths Specialist investigation on complex numbers in polar form, and they say that the best way to learn something is to teach other people, which is what I'm going to do!

These posts really need diagrams... but I'm pretty lazy, so I'll just add diagrams when I feel like it/ when you pressure me to :)

ANYWAY, I'll get to the point.

Polar Coordinates

Most of the time, when you are given coordinates for a graph, you are given the coordinates in rectangular form. Rectangular form is basically (x, y) where x is the number of units to the right and y is the number of units up. Polar coordinates differ quite drastically: they give coordinates in the form (r,θ) where r is the distance from the origin, and θ is the angle anticlockwise from the positive x-axis.

So, how do you go about converting rectangular coordinates to polar form? It's simple...

To find r, the direct distance from the origin, all you have to do is use Pythagoras' theorem. According to Pythagoras' theorem, r^2 = x^2 + y^2, so r is the square root of x^2 + y^2. (This would all make a lot more sense if I put a graph here, but as I said, I'm pretty lazy.)

Finding the angle between r and the x-axis takes a bit more work. Using SOHCAHTOA (sin = opp/hyp, cos = adj/hyp, tan = opp/adj), tan θ is equal to y/x. (Once again, it would be a lot easier to see if I could be bothered drawing a graph.) Therefore, θ is simply the reverse tangent of y/x.

The above was for if the point (x,y) is in the first quadrant of the graph (i.e. x and y are positive). But what happens if the point (x,y) is in a different section of the graph? No worries- you may simply have to add or subtract 180 or 360 to give the anticlockwise angle from the point (x,y) and the positive x-axis. If the graph lies in the 2nd quadrant (i.e. x is negative, y is positive), you need to subtract the angle from 180 degrees. If the graph lies in the 3rd quadrant (i.e. both x and y are negative) then you need to add 180 degrees. If the graph lies in the 4th quadrant (i.e. x is positive, y is negative), then you need to subtract the angle from 360 degrees. If you ever get confused, draw a graph and draw an angle anticlockwise starting from the positive x-axis. Diagrams are a very useful tool for helping your understanding.

By the way, there are two acceptable formats for giving an angle: the angle anticlockwise from the positive x-axis is given as a positive angle, while the angle clockwise from the positive x-axis is given as a negative angle. Therefore, the angle 270 degrees can also be written as -90 degrees.

To convert from polar form to standard Cartesian coordinates, it helps to draw a quick sketch of the triangle with its hypotenuse and angle marked. You can then easily use SOHCAHTOA to find x and y.

Complex Numbers

Complex numbers are made up of two parts: a real part and an imaginary part. They take on the form z = x + yj (i is sometimes substituted for j, but they both mean the same thing). x is the real part, and yj is the imaginary part. j (or i) is equal to the square root of negative one (which is a real number), but x and y themselves are real numbers- one example of a complex number is 5 + 3j.

Let's take any real number and call it a. If you have the square root of a, and you raise it to the power of 2, you end up with a. Similarly, if you take the square root of -1, and you raise it to the power of 2, you should theoretically also end up with -1. As j = -1, j^2 must also equal -1. This is important for complex number arithmetic.

Adding, subtracting and multiplying complex numbers is easy. When adding or subtracting, just add or subtract the real parts together and then add or subtract the imaginary parts. When multiplying, just multiply as you would normally do in algebra. However, if you end up with j^2, make sure to substitute -1 in its place. (Additional substitution may be required for higher powers of j.)

Dividing requires a new concept: the conjugate of a complex number.

Basically, to get the conjugate of a complex number, just change the addition sign to a subtraction sign and vice versa.

When dividing complex numbers, multiply by the conjugate of the bottom number over itself. For example, if you want to do (2 + 3j)/(4 - 6j), multiply by (4 + 6j)/(4 + 6j). This works for two reasons:

Reason 1: Difference of Two Squares.
When you multiply the bottom number by its conjugate, you get a difference of two squares expression. (x + yj)(x - yj) = x^2 + xyj - xyj - (yj)^2. xyj and -xyj then cancel each other out and the resulting expression can be expanded to x^2-(y^2)(j^2). As I have said earlier, j^2 = -1, so (x + yj)(x - yj) = x^2 + y^2 which is a real number! Therefore, after multiplying a fraction by the conjugate of the bottom number over itself, you really end up simply dividing by a real number at the end.

Reason 2: The Conjugate Over Itself is Equal to 1.
When you multiply the fraction by the conjugate of the bottom number over itself, you simplify it so that you are dividing by a real number, but you are not changing the value of the expression. This is because any number over itself is equal to 1. Therefore, when you are multiplying by the conjugate over itself, the value of the expression remains unchanged.

Complex numbers are able to be graphed. The name for the graph is called the Argand diagram but it's actually very similar to any other graph. The main difference is that the x-axis and y-axis are given different names: the x-axis is the real axis and the y-axis is the imaginary axis. To find the location complex number x + yj on the Argand diagram, simply move x units to the right and y units up.

Now on to the next part...

Complex Numbers in Polar Form

Unfortunately, converting complex numbers to polar form isn't as easy as converting normal numbers to polar form. I think that this is because a complex number has two components (real and imaginary), while a normal number only has one real component. Nevertheless, it's not that hard.

First, we have to use a little trigonometry (again, I need a diagram here). Let r be the distance from the origin to the point x + yj on the Argand diagram and θ be the angle counterclockwise between the positive real axis and r.

cos θ = adj/hyp = x / r. Therefore x = r cos θ.
sin θ = opp/hyp = y / r. Therefore y = r sin θ.

Substituting these values into the general complex number form z = x + yj you get:

z = r cos θ + (r sin θ)j = r (cos θ + j sin θ)

Now, using Pythagoras, r = sqrt(x^2 + y^2). Now |z| = sqrt(z multiplied by the conjugate of z). As I stated in the above section about complex numbers, z multiplied by its conjugate is x^2 + y^2. Therefore, |z| = r = sqrt(x^2 + y^2).

Therefore, z = |z| (cos θ + j sin θ).

Some terminology for you: |z| is the modulus of the complex number. θ is the argument (or arg).

Now let's move on to... the powers of complex numbers in polar form.

No, I didn't mean that they had powers, I meant raising them to a power. Don't get too excited.

When you raise z to a power p, the modulus also gets raised to a power p. The argument, on the other hand, simply gets multiplied by the power. It's like the log laws!

log (z^p) = p log z
arg (z^p) = p arg z

Multiplying and Dividing Complex Numbers

Multiplying and dividing complex numbers in polar form are like raising complex numbers in polar form to powers. The modulus gets treated like a normal number while you have to treat the argument like a logarithm.

When multiplying two complex numbers, say z and w, the modulus is simply |z|*|w| = |zw|. The argument is simply arg (z) + arg (w) = arg (zw).

When dividing two complex numbers, say z and w, the modulus is simply |z|/|w| = |z/w|. The argument is simply arg (z) - arg (w) = arg (z/w).

I think that the laws about multiplying, dividing and raising the modulus to a power are the same as those around normal numbers because the modulus is an ordinary real number as well. But why are the above laws surrounding arguments the same as the laws surrounding logs? Let's take a brief glance at two trigonometry laws and see how we can use them to explain multiplying (and possibly dividing too). These laws are:

cos (θ + φ) = cos θ cos φ - sin θ sin φ
sin (θ + φ) = sin θ cos φ + cos θ sin φ

Let z = |z|(cos θ + j sin θ)
Let w = |w|(cos φ + j sin φ)

zw = |z|(cos θ + j sin θ)|w|(cos φ + j sin φ)
= |zw|(cos θcos φ + i sin θcos φ + cos θ i sin φ + i sin θ i sin φ)
= |zw|((cos θcos φ - sin θsin φ)+ i(sin θcos φ + cos θsin φ))

Using the laws stated previously,

zw = |zw|(cos (θ + φ) + sin (θ + φ))

The modulus of z and w have been multiplied together and the arguments have been added together.

There's a website on how to explain why arg(z^p) = p arg (z), but it looks too confusing for me. If you're interested, though, you can find it at http://math.tutorvista.com/trigonometry/de-moivre-s-theorem.html .

Sunday, December 2, 2012

Those stupid aeroplane questions

Everyone who does Spec will know what I'm talking about. "This aeroplane wants to fly from airfield A to airfield B, but there's a wind blowing from x direction at x velocity. What direction should the plane fly in?" I hate these questions for two reasons. 1) They're annoying. 2) I like planes and I abhor their usage in annoying questions. Unfortunately, if you do Spec you'll have no other choice than to encounter and solve them.

Let's have a look at one of these questions- this time using a helicopter, not an aeroplane. Good riddance to helicopters.

A helicopter can fly at 75m/s in still air. The pilot wishes to fly from airport A to a second airport B, 300km due North of A. If i is a unit vector due East and j a unit vector due North find (in the form ai + bj) the velocity vector that the pilot should set and the time the journey will take if
a) there is no wind blowing,
b) there is a wind of (21i + 10j) m/s blowing.

Part a) is easy. Since there is no wind to affect the movement of the helicopter, the helicopter can just fly directly North for 300km (i.e. with a velocity vector of 75j). You can then use distance / speed to get the time required. You do need to be careful in this one- you have to convert m/s into km/h, or you can convert km into m.

75*3.6 = 270 km/h
300/270 = 1.11 hr = 1 hr 7 minutes (nearest minute)

Alternatively:
300*1000 = 300 000 metres
300000/75 = 4000 seconds = 66.7 minutes (1 d. p.) = 1 hr 7 minutes (nearest minute)

Now part B... that's the part I hate simply because it requires more work. Drawing a diagram can help to visualise the situation.

I have to admit that my diagram is a bit misleading (especially because I've only just realised that I wrote "aeroplane" instead of "helicopter" and "airfield" instead of "airport" out of sheer habit). Unless the journey is complete in exactly 1 second or 1 of whatever unit of time you're using, the resultant of the wind and aircraft vectors will not be equal to the distance to the airport or wherever the question's asking you to go to. The resultant is a scalar multiple of the position vector of the second airport relative to the first- that is, it's in the same direction, but shorter or longer.

Now, the question said that the helicopter can go at 75m/s in still air. This means that the magnitude of the aeroplane's velocity should be 75m/s. If we let the helicopter's velocity be xi + yj m/s, then we can create this equation for x and y:

sqrt(x^2 + y^2) = 75 m/s

Now, as you probably already know, when we have 2 variables, we need at least 2 equations to solve for the variables. We can get another equation by adding together the wind and helicopter vectors- as previously mentioned, the resultant should be a scalar multiple of the position vector of the second airport relative to the first. Sounds like a lot of garble, but it's actually not that complex.

21 i + 10 j + xi + yj = k(300 000j) where k is a constant.

Then just equate the i components and the j components separately.

21 + x = 0
therefore x = -21

10 + y = 300000k

Since this example is quite easy we can get a result for x straight away. We can then substitute it into that equation we had earlier to work out what y is.

sqrt((-21)^2 + y^2) = 75 m/s

y = 72 (reject -72 as we can see from the above diagram that y has to be positive)

Therefore, the velocity vector of the plane is -21i + 72j m/s.

To work out resultant velocity, add wind and helicopter velocities together. You can then work out the magnitude from there and use that to complete the question.

21i + 10j - 21i + 72j = 82j

|82j| = 82m/s = 295.2km/h
300/295.2 = 1.02 hours = 61 minutes (nearest minute)

And that's how you solve an aeroplane question!

That was a relatively simple question, though, since the velocity vector is directly north. Here I'll give a very brief explanation on what to do if the velocity vector isn't directly north. I might expand on it later if I can be bothered.

Write out the position vector of the second location relative to the first in component form. For example, if the airport was actually 300km north-east, you could write it as 300 cos 45 i + 300 sin 45 j. It doesn't matter here whether you use the same units (kilometres or metres) as your velocity vectors, since these numbers are going to be cancelled out soon anyway.

When you equate the velocity vectors to a scalar multiple of the position vector, you'll end up with this:

21 i + 10 j + xi + yj = k(300 cos 45 i + 300 sin 45 j)

Equating i and j components:

21 + x = 300 cos 45 k
10 + y = 300 sin 45 k

Divide the first equation by the second and rearrange it to get an equation for x or y.

(21 + x)/(10 + y) = (300 cos 45 k)/(300 sin 45 k)
(21 + x) / (10 + y) = cos 45 / sin 45
21 + x = (cos 45 / sin 45)(10 + y)
x = (cos 45 / sin 45)(10 + y) - 21

You could then substitute this into the sqrt((-21)^2 + y^2) = 75 m/s equation.

By the way, the equation x = (cos 45 / sin 45)(10 + y) - 21 could be further simplified to x = 10 + y - 21 and then x = y - 11 because cos 45 happens to be equal to sin 45. The only reason I left them unsimplified is because you won't always get nice numbers that can simplify down like that.

Thursday, October 11, 2012

Logarithms

I'm baaaack! But this time I'm not talking about Chem: I'm here to talk about maths. About logs, to be exact. Mathematical logs. I'll never know why maths and chemistry like using the names of other objects to name stuff (I'm looking at you, 6.022 x 10^23, that number that chemistry named "the mole"), but at least in this case "log" is an abbreviation of something. Anyway, this is rather off topic.

I'm sure in your mathematical career you've encountered indices or exponentials. You know, those numbers to the power of something. Square numbers. Cubic numbers. Quartics. And so on. Well, logarithms are just the reverse of indices. Just like how multiplication and division are opposite processes.

Now, in exponentials, the big number at the bottom is called the base and I'm pretty sure the little number in the top right is the power. So in 2^3, the 2 is the base and the 3 is the power. Now, you see, logarithms also have different bases, as indicated in a little subscript next to the word "log"...


log2 = base 2 log
log3 = base 3 log

and so on. The most common base is base 10, so if you see "log" without a subscript, it's base 10 that's being referred to.

Now, as I said before, logarithms are the opposite of exponentials. In exponentials, you have (base)^(power) = answer, but what happens if you have the base and the answer, but not the power? Well, this is where logs come in.

Let's start simple. 2^x = 8. Now, log2 8 = x. Do you see what I did there? I put the base as a subscript next to the word "log" and then the answer. (I'm sure there's another term for this which is less vague than "answer," but I don't know what it is.) x = 3 because 2^3 = 8.

But wait, you might ask. What happens if you get given some crazy numbers so you can't work out what x is in your head? Well, this is where log laws come in.

You see, logs are the opposite of indices, so log laws are the opposite of index laws. If you multiply two exponentials together, you add the indices together. Conversely, if you add two logs together, you multiply the number next to the word "log" (not the subscript, I mean, the other number. I really need to know what this number's called...). If you divide an exponential by another, you subtract the indices. Conversely, if you subtract two logs, you divide the indices. There's explanations for these but I don't really want to put them up until I know what that damn other number is called, because I'm probably already confusing you enough as it is.

There's also another important log law to learn. If that-number-which-I-don't-have-a-name-for is an exponential (e.g. 2^3 or 3^5 or whatever), then you can rearrange it like this:

log2 (2^3) = 3 log2 2

Basically I've just taken the power down to the front.

Two more things that you need to know: if the base is equal to that number, then the answer's 1. That's because when you raise any base to the power of 1, the result is the same as the base. Also, if that number is 1, then the answer's 0, because anything to the power of 0 is 1.

Okay. That was a really confusing explanation, mainly because I don't have a name for that number, and I really need a name that's less vague than "answer." One day I'll clean up this post. One day...

Saturday, September 29, 2012

Projection Vectors

In that same worksheet that the question about closest approach came from, there was also a question about projection vectors.

Find the projection of 4i - 3j onto the vector 12i + 8j.

First I had to find out what a projection vector was. So I asked my Spec teacher.

With the vectors 4i - 3j and 12i + 8j, as illustrated below:


The projection vector is the purple part on the next diagram:


The projection of a vector onto another is the effect of that vector in the direction of the other vector. (I'm not 100% sure what this means, but I'll get there eventually.)

As can be seen from the diagram, you can draw a line between the 4i - 3j vector and a particular point on the 12i + 8j vector which is perpendicular to the 12i + 8j vector. (It's a bit like those closest approach questions.) The particular point where the lines intersect has a position vector identical to the projection vector of 4i - 3j on 12i + 8j. Therefore, finding the projection vector is all about finding this particular point.

Hopefully that wasn't too confusing.

As you can see above, we have a nice little right-angled triangle. Here it is, rotated because it's easier to understand (in my opinion, anyway).


Let us call 4i - 3j b, and the purple line x.

Using simple trigonometry cos(theta) = |x|/|b|. Therefore |x| = |b| cos(theta).

Now we need to work out cos(theta). Remember, theta in this case is the angle between 12i + 8j (which I'm going to call "a," by the way), and 4i - 3j (which I called "b" not too long ago).

Let's use the scalar product equation to find cos(theta). a(dot)b = |a||b|cos(theta) can be rearranged to cos(theta) = (a(dot)b)/(|a||b|).

Therefore x = (|b|(a(dot)b))/(|a||b|). The |b| then cancels out to give (a(dot)b)/|a|.

This only gives us the magnitude of line x, however. We also need to find the direction, which is in the same direction as line a.

As I'm sure you probably already know if you're also doing 3AB Spec, if you want to find a vector of a certain magnitude in the same direction of another vector, you just need to multiply the desired magnitude by the unit vector (since the unit vector has a magnitude of 1). Therefore, we need to multiply the magnitude of x by the unit vector of a.

The unit vector of a can be represented by the symbol â, or by a/|a| (i.e. vector a divided by the magnitude of a).

Therefore the projection vector is as follows:

((a(dot)b)/|a|)/(a/|a|)

which can be simplified to:


which can be simplified even further to:

(â.b)â

Hopefully my explanations weren't too complex and you now at least have some kind of understanding of projection vectors! Yeah... it was a real Eureka moment yesterday when I understood...

Thursday, September 27, 2012

Scalar Product- Closest Approach

Okay, this seems a bit too complex for a first post, but I wanted to share what I learned today. Or at least what I think I've learned. If I'm totally wrong, please do share because then I could learn from it. One day, I'll go back and write about topics that lead up to this.

I was struggling with this question in my Spec homework, but I think I've got it now.

Here's the question:

Two walkers Harry and Claire are at (30, -17) km and (18, 15) km at 9.30am Saturday, travelling with velocities of (6, 4) km/h and (8, -2) km/h respectively.
a) Find the closest distance that they come to each other.
b) Find the time when they are closest.
c) Find the positions of Harry and Claire when they are closest.
d) Find Harry's position relative to Claire's position as a distance and bearing when they are closest.

The first thing that I did was do some adjusting to make Claire appear to "stand still" at the origin while Harry moved. It's easier to work with an object moving near a still object than with two moving objects.

To do this, I subtracted Claire's position vector from both Harry and Claire's position vectors:

r(C) = (18i + 15j) - (18i + 15j) = 0i + 0j (the origin)
r(H) = (30i - 17j) - (18i + 15j) = 12i - 32j (this is the same as the position vector of Harry relative to Claire)

Next I made Claire "stand still" by subtracting Claire's velocity vector from both Harry and Claire's velocity vectors:

V(C) = (8i - 2j) - (8i - 2j) = 0i + 0j (at rest)
V(H) = (6i + 4j) - (8i - 2j) = -2i + 6j (this is the same as the velocity vector of Harry relative to Claire)

Now we have C at rest at the origin, and H at (12i - 32j) km travelling with the velocity of (-2i + 6j) km/h, as in the diagram below (not to scale):


Now, as you hopefully already know, when working out closest approach, you need to find the spot where the line between the point C and the line H is perpendicular to the line H. If that didn't make sense, here is a diagram:


The thick blue line is the shortest distance between C and the line H.

But how should we go about working out how long this line is? First, we let the point where the two lines meet be Point P.

Next, we work out the vector equation for the red line, which is relatively easy:

H = 12i - 32j + t(-2i + 6j) (where t is time in hours)
H = (12 - 2t)i + (6t - 32)j

Now we have to find the position vector of point P. Since P lies along the line H, the position vector of P is simply (12 - 2t)i + (6t - 32)j. We just need to find out what t is, and we'll get to that eventually.

Now, since CP (which is equal to the position vector of P since C is at the origin) is perpendicular to HP, CP(dot)HP is equal to 0. This gives us the following equation:

((12 - 2t)i + (6t - 32)j)(dot)(-2i + 6j) = 0

You might want to know why I don't have to work out what HP is and why I'm just using the velocity vector of line H. Let's just say that two lines, A and B, are perpendicular, that is, they meet at a 90 degree angle. Line A will also be perpendicular to any other line that is parallel to B due to corresponding angles in parallel lines, as can be seen in the diagram below. The vector equation of the line is (point on the line) + (scalar multiple of direction of line). Since only the direction contributes to the gradient of a line, the position vector is irrelevant if you only care about parallel and perpendicular lines, and therefore it can be omitted in this case.


Sorry if that was a terrible explanation. Anyway, back to the original problem at hand:

((12 - 2t)i + (6t - 32)j)(dot)(-2i + 6j) = 0 expands to
-24 + 4t + 36t - 192 = 0 which then simplifies to
40t = 216
t = 5.4

Yay, we now have a t value, so we can work out what the position vector of P is by substituting this value in! Since the position vector of P is equal to CP, finding the magnitude of this will give you the shortest distance!

CP = (12 - 2(5.4))i + (6(5.4) - 32)j
| CP | = 1.26km (2 d.p.)

a) The closest distance between Harry and Claire is 1.26km (2 d.p.).

You can also use the t-value from before to get answer the second part. Just convert 5.4 hours to hours and minutes and add it to 9.30 am, and away you go!

5.4 hours = 5 hours 24 minutes
9.30am + 5 hours 24 minutes = 2.54pm

b) The time at which they are closest is 2.54pm.

It's easy to find the position vectors of Harry and Claire when they are closest. First you have to go way back to the beginning of the question- before you stopped Claire and confined her to the origin. The vector equation for Claire's original movement is (30i - 17j) + t(6i + 4j) and the vector equation for Harry's original movement is (18i + 15j) + t(8i - 2j). Substituting our t-value into these equations will give you the position vectors of Harry and Claire when they are closest.

c) Harry is at (62.4, 4.6) while Claire is at (61.2, 4.2).

The last part isn't too hard either. All you have to do is work out the differences in x-values and the differences in y-values between Harry and Claire. By doing some simple subtraction you can see that Harry is 1.2 km east and 0.4 km north of Claire. I then put this into a simple diagram:


This part should hopefully be really simple. To find the position of Harry relative to Claire as a distance, just use Pythagoras' theorem: sqrt(0.4^2 + 1.2^2). This should hopefully give the same minimum distance as in part a). The bearing is likewise not too difficult. Just use arctan(0.4/1.2) to get the angle. Then, since the angle is in the first quadrant, subtract the angle from 90 degrees to get your bearing.

d) Harry's position relative to Claire's position is 1.26km on a bearing of 71.57 degrees (2 d.p.)

Hopefully my method helped you and I'm not teaching you any wrong methods! If any of you find anything that needs fixing, please tell me so that I don't confuse a bunch of other people...