How to Find Velocity at Final Location Using Mathematica?

Click For Summary
SUMMARY

This discussion focuses on calculating velocity at a final location using Mathematica in the context of a restricted three-body problem. The user successfully exported position data at various time intervals using the NDSolve function. To find the velocity, it is recommended to utilize the D[] function for numerical differentiation of the position data. The conversation also touches on exporting data to CSV format for further analysis in Excel.

PREREQUISITES
  • Familiarity with Mathematica and its NDSolve function
  • Understanding of numerical differentiation techniques
  • Basic knowledge of exporting data in CSV format
  • Experience with plotting data in Mathematica
NEXT STEPS
  • Learn how to use the D[] function in Mathematica for differentiation
  • Explore advanced features of NDSolve in Mathematica
  • Research methods for numerical differentiation in Excel
  • Investigate data visualization techniques in Mathematica
USEFUL FOR

Researchers, physicists, and students working on celestial mechanics or simulations involving multiple bodies, particularly those using Mathematica for data analysis and visualization.

Dustinsfl
Messages
2,217
Reaction score
5
I used mathematica to solve a restricted 3 body problem and was able to export my position data at different time intervals. How can I find my velocity at that final location?
 
Physics news on Phys.org
What mechanism did you employ in Mathematica to get your position object? NDSolve? If so, you should be able to differentiate it numerically by using the usual D[] function.
 
Ackbach said:
What mechanism did you employ in Mathematica to get your position object? NDSolve? If so, you should be able to differentiate it numerically by using the usual D[] function.

I obtained my position data by
Code:
XYdata = Flatten[
   Table[Evaluate[{x1[t], x2[t], x3[t]} /. s], {t, 0, 122400, 3}], 1];
SetDirectory[NotebookDirectory[]];
Export["OrbitData.txt", XYdata, "CSV"];
Earth = {N[x1], 0};
L4 = {N[xL4], N[yL4]};
Export["Earth.txt", Earth, "CSV"];
 
So are you now looking at the data in Excel, or Mathematica? Because you should be able to do x1'[t]/.s to get the derivative in Mathematica. In Excel, you'd have to have the time data as well as the position data. Then you could compute a numerical derivative.
 
Here is the plot of my trajectory to L4.
The moon is the green dot in the bottom and Earth is blue.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 18 ·
Replies
18
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K