How to Find Velocity at Final Location Using Mathematica?

Click For Summary

Discussion Overview

The discussion revolves around finding the velocity at a final location in a restricted three-body problem using Mathematica. Participants explore methods for differentiating position data to obtain velocity, as well as the tools and data formats involved in the process.

Discussion Character

  • Technical explanation, Exploratory, Homework-related

Main Points Raised

  • One participant describes using Mathematica to solve a restricted three-body problem and exporting position data at different time intervals.
  • Another participant suggests using the D[] function in Mathematica to numerically differentiate the position data if NDSolve was employed to obtain it.
  • A participant reiterates the suggestion about using D[] for differentiation and provides a code snippet for exporting position data.
  • There is a question regarding whether the data is being analyzed in Excel or Mathematica, with a suggestion that Mathematica can directly compute derivatives using x1'[t]/.s, while Excel would require both time and position data for numerical differentiation.
  • One participant shares a plot of their trajectory to L4, indicating the positions of the moon and Earth.

Areas of Agreement / Disagreement

Participants appear to agree on the use of Mathematica for differentiation but have not reached a consensus on the best approach or the specific tools being used for data analysis.

Contextual Notes

There are unresolved details regarding the specific methods used to obtain position data and the exact process for calculating velocity from that data.

Who May Find This Useful

This discussion may be useful for individuals working on computational physics problems, particularly those involving numerical methods in Mathematica and data analysis techniques.

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
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · 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