Excel help required

pattersoncr

Tutorial Publisher
Tutorial Publisher
Joined
Oct 17, 2007
Messages
417
Reaction score
3
Points
18
Location
Eastern PA
I'm usually an excel ninja but this is kicking my butt.
I'm trying to make an excel lunar transfer dV calculator using equations from this website:
hthttp://www.braeunig.us/space/orbmech.htm#maneuver
I'm tring to turn equation 4.64 (eccentric anomaly) into an excel formula:
eq4-60.gif

using the numbers from practice problem 4.18, here is what I'm puting into excel (raw number substisuted fro cell references):
=ATAN(POWER(1-POWER(D15,2),0.5)*SIN(157.7)/(D15+COS(157.7)))
instead of the desired 2.11 radians, I excel gives me .224

Any one know where I'm going wrong?
 
Try checking to see if it's the ATAN function. You might be in the wrong quadrant... only thing that's apparent to me as being a potential problem. Btw, ATAN2() typically will solve that problem.
 
Check degrees versus radians. Many programs take radians for sin, cos, etc. It looks like you're giving it degrees.

EDIT: Okay, maybe you did that already. XD
EDIT2: Looks like I get the same answer. It's really close to looking like they just misplaced the decimal.
 
Last edited:
=ATAN(POWER(1-POWER(D15,2),0.5)*SIN(157.7)/(D15+COS(157.7)))
...
Any one know where I'm going wrong?
Judging by the magnitude of the highlighted number, you are entering the true anomaly in degrees. The excel sin and cos functions will expect that value to be in radians.
 
Arrowstar,
ATAN2() loos for two arguements (x,y coordinates) rather than just an angle.

Nick,
I've tried every combination of degree/rad I can think of, without success.

---------- Post added at 07:34 PM ---------- Previous post was at 07:33 PM ----------

tblaxland,
I am entering it in degrees. When I use rad, I get a negative result.
 
tblaxland,
I am entering it in degrees. When I use rad, I get a negative result.
Ah, I see. If you add PI() to it, you will get the right answer. As Arrowstar points out, it is just a quadrant issue. As a general rule, when use the atan function you need to make sure that the sign of the result is the in the correct quadrant by making sure the sign of the arctangent is the same as the sign of the sine. The best alternative is to use the ATAN2() function, as suggested by Arrowstar:
Code:
=ATAN2(D15+COS(2.75),POWER(1-POWER(D15,2),0.5)*SIN(2.75))
 
tblaxland,
thanks for the help.
I'll add pi and have some desert :)

As to ATAN2(), this function looks for an x,y coordinate rather than an angle. I guess I don't know how to use ATAN2().

---------- Post added at 08:33 PM ---------- Previous post was at 08:27 PM ----------

Now for my next question, so that I don't need to get masochistic with the algebra, does anyone have equations similar to the above but using transfer time (TOF) as an input rather than semi-major axis?
 
As to ATAN2(), this function looks for an x,y coordinate rather than an angle. I guess I don't know how to use ATAN2().
I posted the formula for you to use. atan2(x,y) is the equivalent of atan(y/x).

A word of caution: check the order of the arguments that the atan2 function expects if you want to use this function in a different application. For example most programming libraries provide a function which expects atan2(y,x) but Excel is unusual in that it expects atan2(x,y).
 
Back
Top