Orbiter-Forum Can I get the Vector components xyz given only this information?
 User Name Remember Me? Password
 Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

 Math & Physics Mathematical and physical problems of space flight and astronomy.

 06-02-2019, 01:35 AM #1 ncc1701d Orbinaut Can I get the Vector components xyz given only this information? hello, I have these 3 dates and I know the position X Y Z of moon Amalthea relative to Jupiter and then I know the Velocity Vectors V for each one. I need to get the VX VY VZ components for each of the 3 date-times. Do I have enough information to get those from what you see? I believe I need the instantaneous values. I am aware of VX = dx/dt, VY = dy/dt, VZ = dz/dt and I know VX + VY + VZ = V I am interested in the math behind finding those components given what I have. If you know the procedure can you tell me what it is? or shed some light on how I might solve the problem if its possible? thank you. 1979 MAR 05 00:00:00 -178932.619 km -28063.045 km -17448.755 km V = -29.804114 km/sec 1979 MAR 05 00:02:00 -178337.419 km -30878.143 km -18771.071 km V = -29.231286 km/sec 1979 MAR 05 00:04:00 -177688.033 km -33683.859 km -20087.682 km V = 28.649604 km/sec thank you. I do have the answers if someone knew how to do it. I can check to see if your right. Last edited by ncc1701d; 06-02-2019 at 01:45 AM.
 06-02-2019, 01:48 AM #2 Quick_Nick Passed the Turing Test If I understand correctly, you have XYZ position information and a speed, and you want XYZ velocity information. This can get really complicated if you care about a perfect answer. However I would say simply knowing that the orbit is nearly circular and nearly equatorial is enough information to have a pretty good idea of the velocity vector. You need to know what coordinate frame those XYZ values are in though. Edit: I'm thinking you may actually care about a more accurate answer given your three times are less than an orbit apart. I suspect you can in fact evaluate those three points together to get some orbital parameters out. Last edited by Quick_Nick; 06-02-2019 at 01:55 AM.
 06-03-2019, 01:16 PM #3 Marijn Orbinaut I think this article describes the required math. It's not easy. https://science.larouchepac.com/gaus...erProblem.html
 Thanked by:
 06-06-2019, 02:32 PM #4 BrianJ Addon Developer Hi, thanks for the interesting problem to think about :-) I can get the semimajor axis (a) and the standard gravitational parameter (mu) from the vis-viva equation; v^2 = mu*(2/r - 1/a) But then I get stuck! Then I thought maybe it was an energy-conservation problem (Potential + Kinetic = Constant) but I'm not getting anywhere with that. Since the times of the data points are given, I'm pretty sure that is necessary information. Needs some kind of insight regarding Kepler's 2nd law (radius sweeps out equal areas in equal times) maybe? I think that the shape of an ellipse is completely determined by three points (pos vectors), so theoretically you should be able to find the equation of the ellipse and the tangent at a given point - but the math for doing that in 3D is looking really gnarly, so I'm not even thinking about that :-) Anyway, I'm having fun playing with this one. Cheers, Brian P.S. Your first two Velocity values are negative - typo?
 06-06-2019, 06:08 PM #5 ncc1701d Orbinaut the checkmarked answer I found here might provide the answer. https://stackoverflow.com/questions/...elocity-vector Although not sure its that simple yet. I am still researching.
 Thanked by:
 07-12-2019, 08:49 PM #7 BrianJ Addon Developer Hi, wow! Thanks so much, I would never have got those later steps. Magic indeed
 Thanked by:
 07-13-2019, 03:38 AM #8 MontBlanc2012 Orbinaut Actually, it occurs to me that the solution to ncc1701d's original problem is actually quite trivial - given that we are given the time of flight on each of the arc segments (120 seconds each). This means that the information about speeds is superfluous and one just needs to use a standard Lambert Solver to solve the problem. However, we can also use the maths set out above to do the same job of solving the Lambert Problem, - so, in outline, here's the solution: In SI units, the first and second Jupiter-centric positions of Amalthea are: We also know that for Jupiter, the accepted value (in SI units) of the gravitational parameter is . And we know the time of flight is 120 seconds. As before calculate: Now set and as functions of an as yet unknown semi-major axis : where and are the two roots of the equation . As it turns out, for elliptical orbits, the transfer time from the initial to final points can be calculated as: So, now we have an expression that is a function of only. And since we know that the orbit of Amalthea is almost circular, we use a standard Newton root-finding algorithm with an initial guess of 180,000 km. From this, we deduce that: and hence and Then, the radial and transverse components of the velocity vector at the are given by: and the radial and transverse components of the velocity vector at the are given by: And from this it is straightforward to convert back to the x-y-z coordinates of the original coordinate system. N.B. In case you were wondering what the orbital eccentricity is, we get this from the expression: i.e., very nearly a circular orbit. Yay! ---------- Post added at 03:38 AM ---------- Previous post was at 02:15 AM ---------- And finally, just a quick comment on ncc1701d's summation of velocity vector components (V = VX + VY + VZ). Initially, I thought this was a typo and ncc1701d really meant V^2 = VX^2 + VY^2 + VZ^2 - which is, by far and away the more conventional way of 'adding' velocity components. As it turns, out, I was wrong: ncc1701d actually did mean the straight arithmetic sum of the velocity components. How do I know this? Well, I can calculate the x-y-z representation of the radial and transverse unit vectors at that point. Although I'm not going to bother showing the intermediate calculations, in x-y-z coordinates the radial unit vector is: and the transverse unit vector is: So, the velocity vector at the first point in ncc1701d's list can be written as: So, at that point, VX = 4734.483; VY = -23495.74; and VZ = -11041.87. And the straight arithmetic sum of those is -29803.12 which is suspiciously close to the value given by ncc1701d of -29804.11. Last edited by MontBlanc2012; 07-17-2019 at 03:43 AM.
 Thanked by:
 07-14-2019, 03:26 PM #9 BrianJ Addon Developer Thanks for the further insight. I was on the wrong track to start with, since I had assumed the OP actually meant V^2 = VX^2 + VY^2 + VZ^2. Note to self: always read the question carefully! Cheers, Brian
 Thanked by:
 07-16-2019, 07:35 AM #10 ncc1701d Orbinaut thank you everyone for all the feedback!
 09-25-2019, 06:15 AM #11 MontBlanc2012 Orbinaut This is a short follow-up from earlier posts in this thread. In post #8, I outlined a method for calculating the radial and transverse components of the initial and final velocity vectors of the Keplerian arc connecting the initial and final points, and . from this, I said that is is easy to calculate the fuel 3-vector form of the velocity vectors using standard coordinate transformations. While this is all true, it occurred to me that ought to be a more efficient way of carrying out these calculations. And indeed there is! Such a method uses quaternion algebra - so, for completeness, I thought I would set out an updated method: Step 1 As before, I'm going to assume that we know the initial and final positions along the Keplerian arc, and , and as before we also know the semi-major axis, of the Keplerian arc; and the gravitational parameter, . (N.B., in the above posts, the semi-major axis was calculated from a time-of-flight equation.) Then, calculate the following quantities: Here, and are just the distances of the initial and final points from the centre of the gravitating body; is just the sum of these two distances; and is the length of the chord connecting the initial and final point. The quantity doesn't have a simple geometric interpretation, but it is just a simple function of and . Note, though, the in front of the square root in the expression for . Here, we have to make a choice about the sign of that we want to use in our calculations and the way to do that is as follows: imagine that in moving from the initial point to the final point , as seen from the gravitating body, the satellite traces out a trajectory across the sky that spans some angle . If that angle is between and (a 'short' arc), we use the positive sign to calculate . And if the angle traced out is between and (a 'long' arc), we use the negative sign to calculate . In other words, by choosing the sign of in the above, we elect to examine either the 'short' arc or the 'long' arc. Without further information, both arcs are equally valid solutions to the two-point boundary value problem and we need to supply additional information about our problem if we are to choose between them. Step 2 Before going any further, we need to check that if the given semi-major axis is positive (i.e., an elliptical orbit) that: In other words, if the orbit is elliptical, there is a minimum permissible semi-major axis. If the semi-major axis provided is positive and less then this value, this this value is not consistent with the other data provided. For hyperbolic trajectories, we require only that . (N.B. If the semi-major axis equals the lowest permissible value - i.e., then the resulting trajectories correspond to the least energy transfer between the initial and final points. Step 3 Then, carry out the following simple calculations: Admittedly, it's hard to see a geometric motivation for these calculations and I'm not going to try to justify or explain these expressions in this note - although I have a proof available for those sufficiently motivated to go through it. However, these computations are straightforward with the most complex arithmetic operation used being the calculation of two square roots. Note in particular that no trigonometric functions are used; and there are no coordinate transformations. All expressions involve normal real numbers only. Step 4 Having calculated all of the above as a precursor to the main calculation, we now want to compute two quaternions as follows: (N.B. An arbitrary quaternion can be written in the form: and it's conjugate as ) Step 5 As in the earlier posts, calculate the two roots, , of the quadratic, . These two roots encode all the information that we need about the two possible Keplerian arcs that connect the initial and final points with semi-major axis - given our choice of the sign of . For parabolic orbits where we would expect a divergence in the semi-major axis , we can side-step solving for the roots of the quadratic and simply set . Also note that for elliptical orbits ; and for hyperbolic orbits . Step 6 For each root, , calculate the quaternions and : The resulting quaternions are 'pure' quaternions. To extract the velocity vector at the initial point, one takes the coefficients of , and of to get the x, y and z coefficients of the velocity 3-vector; and similarly for the velocity at the final point. So, problem solved! - the full 3-vector form for the initial and final velocity vectors (and without making use of a single trigonometric function). Some python code This may all seem like computational gobbled-gook but, in actual fact, it is a fast and efficient way of solving the problem. To illustrate, here is some Python code that solves this problem: Code: import numpy as np import quaternion def calcs(X, Y): aa = np.sqrt(2 * mu / (A - B * X)) V1 = aa * (Q2 - X*Q1) * K * np.conj(Q1) / ri V2 = aa * (X*Q2 - Q1) * K * np.conj(Q2) / rf v1 = np.array([V1.x, V1.y, V1.z]) v2 = np.array([V2.x, V2.y, V2.z]) e = np.sqrt(Y * Y + (1 - Y * Y) * (rf - ri)*(rf - ri)/(A*A - B*B)) dt = 2*np.sqrt(a*a*a/mu)*(np.arccos(X)+Y*np.sqrt(1-X*X)) print("The initial velocity vector is (m/s): ", v1) print("The final velocity vector is (m/s): ", v2) print("The orbital eccentricity is: ", e) print("The transfer time is (s): ", dt) print() return # input the inital and final 3-vector coordinates Ri = np.array([-178932619.,-28063045.,-17448755.]) Rf = np.array([-178337419.,-30878143.,-18771071.]) a = 181997386.85 mu = 1.26687e17 # from these inputs, calculate some basic things [xi, yi, zi] = Ri [xf, yf, zf] = Rf ri = np.sqrt(np.dot(Ri, Ri)) rf = np.sqrt(np.dot(Rf, Rf)) A = ri + rf B = np.sqrt(2 * (np.dot(Ri, Rf) + ri * rf)) f1 = np.sqrt((zi + ri) / 2) f2 = np.sqrt((zf + rf) / 2) xi1 = xi / f1 / 2 xi2 = xf / f2 / 2 ze1 = yi / f1 / 2 ze2 = yf / f2 / 2 c = 2 * ( +xi1 * xi2 + ze1 * ze2 + f1 * f2) / B s = 2 * ( -xi1 * ze2 + xi2 * ze1) / B # define some quaternions K = np.quaternion( 0, 0, 0, 1) Q1 = np.quaternion( 0, xi1, ze1, f1) Q2 = np.quaternion( s*f2, c*xi2 - s*ze2, c*ze2 + s*xi2, c*f2) # Find the two roots of the equation A - B X = 2 a (1 - X^2) Xp = (B + np.sqrt(16*a*a - 8*a*A + B*B)) / 4 / a Xm = (B - np.sqrt(16*a*a - 8*a*A + B*B)) / 4 / a # Finally, solve the problem for the first root calcs(Xp, Xm) When this code snippet is run, it produces the following output: Code: The initial velocity vector is (m/s): [ 4734.49198839 -23495.77898041 -11041.88918176] The final velocity vector is (m/s): [ 5185.26925794 -23421.41132194 -10996.18966314] The orbital eccentricity is: 0.0010376147570018118 The transfer time is (s): 119.9998118041033 which matches the values calculated earlier.

 Posting Rules BB code is On Smilies are On [IMG] code is On HTML code is Off You may not post new threads You may not post replies You may not post attachments You may not edit your posts
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Orbiter-Forum.com     Announcements     Meets & Greets Orbiter Space Flight Simulator     Orbiter Web Forum         OFMM         Orbiter Forum Space Station         Simpit Forum     General Questions & Help     MFD Questions & Help     Hardware & Software Help     Tutorials & Challenges     Orbiter SDK     Orbiter Visualization Project     Orbiter Beta » Orbiter Project Orbiter Addons     OrbitHangar Addons & Comments     Addons     Addon Development     Addon Requests     Addon Support & Bugs         Addon Developer Forums             Project Apollo - NASSP     Orbiter Lua Scripting Far Side of the Moon     Spaceflight News     Math & Physics     Astronomy & the Night Sky     Backyard Rocketry     Brighton Lounge     International Forum

All times are GMT. The time now is 01:10 PM.

About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com