PDA

View Full Version : trig problem that's giving me major problems


Nomad84
04-26-2006, 07:12 PM
I'm working on some calculations for my mech. engr. capstone project, and I've hit a deadend. Basically, I started with

X = (h/2) * [cot(w + a) + cot(w - a)]

where h and a are constants. X is the independent variable, and I'm trying to solve for w. After a couple of pages of work using Euler's formula, I ended up with this:

X / h = [sin(2 * w)] / [cos(2 * a) - cos(2 * w)]

I'm pretty much stuck here. I can't isolate w. Can anyone give me some pointers to get me moving in the right direction? Or is it even possible? I'm wondering if I can treat it as one of a pair of equations and solve them simultaneously. The second equation would be something that relates sin and cos (like sin^2+cos^2=1 or something). I've messed with that a little bit, but without success. Right now, I'm just using Excel to "goal seek" by varying w until this equation gives a value of X that is equal to the known value. This requires me to manually tell it to goal seek and type in the target value for each datapoint, which sucks. Is there a way to automate this in Excel? Macros, or something other than goal seek, maybe?

Any help on this would be awesome. Thanks.

PokerPadawan
04-26-2006, 07:34 PM
Use the identities

tan(w+a) = (tan w + tan a) / (1 - tan w tan a), and
tan(w-a) = (tan w - tan a) / (1 + tan w tan a).

Flip these for cot(w+a), obviously. Then solve for a quadratic equation in tan w by multiplying by the denominators all the way through. Use the quadratic equation solution to get tan w, and then take the arctan to get w.

Nomad84
04-26-2006, 09:33 PM
[ QUOTE ]
Use the identities

tan(w+a) = (tan w + tan a) / (1 - tan w tan a), and
tan(w-a) = (tan w - tan a) / (1 + tan w tan a).

Flip these for cot(w+a), obviously. Then solve for a quadratic equation in tan w by multiplying by the denominators all the way through. Use the quadratic equation solution to get tan w, and then take the arctan to get w.

[/ QUOTE ]

This seems to be working. I haven't plugged this into excel yet, but unless I made an arithmetic error somewhere, I think I have what I need. I think that when I went to Euler's formula, I basically ended up simplifying things too much (to sines and cosines). I appreciate your help.

Nomad84
04-26-2006, 09:56 PM
Alright...it's not working. At zero volts, w should equal 60 degrees, but I'm getting 30 right now. This sucks /images/graemlins/frown.gif

Borodog
04-26-2006, 09:58 PM
Excel?

Nomad84
04-26-2006, 10:27 PM
[ QUOTE ]
Excel?

[/ QUOTE ]

This is for a spreadsheet that will be used in a junior level solid mechanics lab. The idea is that the students should be able to plug in the data read from a sensor (the X value) and the spreadsheet should spit out the value of w, which is the angle of a laser beam. From this angle, they can find the angle of tilt of an array of micromirrors for whatever voltage is being applied to the mirrors. The goal is to produce a graph of the mirror tilt angle versus the applied voltage. At zero volts (and therefore zero tilt), w is 60 degrees. If the mirror tilts x degrees, then w will become (60-2x) degrees. The sensor is horizontal. It gives the position of the centroid of the spot of light that hits it. Because we use a lense to focus the laser on the mirrors, we end up with a cone of light coming up from the mirrors, and the center axis of the cone does not correspond to the centroid of the light spot on the sensor. I'm trying to come up with the formula that will correctly account for this error.

I just now discovered an old error in my spreadsheet that gave resulted in an incorrect value of X. I had set the reference value of X using tan instead of cot. Fixing that error gives me the correct results. Thanks again for the help from PokerPadawan!

PokerPadawan
04-26-2006, 11:20 PM
Glad I could help. Writing an quadratic (or cubic or quartic) equation in terms of a trig function is probably the most common way I solve these problems.

Yet another incredibly useful trick that I was never taught in school. /images/graemlins/grin.gif