How to Find Velocity at Final Location Using Mathematica?

In summary, the conversation discusses how the speaker used mathematica to solve a restricted 3 body problem and export their position data at different time intervals. They also mention finding their velocity at the final location and using mechanisms such as NDSolve and D[] in Mathematica to obtain the position object. The conversation also touches on the possibility of using Excel to compute a numerical derivative.
  • #1
Dustinsfl
2,281
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
  • #2
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.
 
  • #3
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"];
 
  • #4
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.
 
  • #5
Here is the plot of my trajectory to L4.
The moon is the green dot in the bottom and Earth is blue.
 

FAQ: How to Find Velocity at Final Location Using Mathematica?

What is a restricted 3 body problem?

A restricted 3 body problem is a mathematical model used to describe the motion of three bodies, such as planets or stars, that are influenced by each other's gravitational pull. In this problem, one of the bodies is significantly smaller in mass compared to the other two, and its effect on the other bodies is negligible.

How is Mathematica used to solve this problem?

Mathematica is a powerful software program that uses numerical and analytical methods to solve complex mathematical problems. In the case of a restricted 3 body problem, Mathematica can be used to simulate the motion of the three bodies and calculate the velocity at the final location.

What are the inputs required for solving this problem in Mathematica?

The inputs required are the masses of the three bodies, their initial positions and velocities, and the gravitational constant. These values are used to set up the equations of motion and solve them using numerical methods in Mathematica.

How accurate are the results obtained from Mathematica?

The accuracy of the results obtained from Mathematica depends on the precision of the input values and the numerical methods used for solving the equations. With proper inputs and methods, Mathematica can provide highly accurate results for solving a restricted 3 body problem.

Can Mathematica be used for other types of celestial mechanics problems?

Yes, Mathematica can be used to solve a wide range of celestial mechanics problems, including restricted 3 body problems, n-body problems, and orbit determination problems. It is a versatile tool for simulating and analyzing the motion of celestial bodies in space.

Similar threads

Replies
3
Views
2K
Replies
9
Views
859
Replies
5
Views
2K
Replies
1
Views
2K
Replies
1
Views
933
Replies
23
Views
3K
Replies
19
Views
1K
Replies
18
Views
4K
Back
Top