Message Boards Message Boards

Solve 2 coupled 2nd ODEs and plot them with ParametricPlot?

Posted 6 years ago

I am interested to solve two coupled 2nd order differential equations and plot the solution using ParamatricPlot. Can anyone help me to resolve this issue? The solution is a trajectory of a particle under the influence of gravity. So, I am also interested to animate the trajectory of the particle as well. I have attached the Mathematica script with this post.

Attachments:
POSTED BY: Soumen Basak
14 Replies
Posted 6 years ago

Dear Mariusz Iwaniuk, This is just a continuation of my previous post on the trajectory of the particle. The trajectory is not periodic if you run it for long time. In order to make the trajectory periodic up to a good accuracy, I tried to estimate the initial velocity of the particle (i.e. black dot) given the initial position and working precision under consideration. However, I am struggling with FindMinimum function to get the final results. Please help me to find any syntax error in notebook.

Regards Soumen

Attachments:
POSTED BY: Soumen Basak

See attached file:

Attachments:
POSTED BY: Mariusz Iwaniuk
Posted 5 years ago

Dear Mariusz, Hope you are ding fine. I have attached a Mathematica notebook which gives a trajectory of the particle. It has been adapted from the notebook https://www.physics.uci.edu/~etolleru/KerrOrbitProject.pdf. I am struggling a get the animation of the trajectory of the particle (e.g. the particle as black solid dot and the trajectory as red curve). So I need your help on this matter.

Best wishes, Soumen

Attachments:
POSTED BY: Soumen Basak
Posted 6 years ago

Dear Mariusz Iwaniuk, Thanks for your response. Following your response I have made necessary corrections in my notebook. However, I still find error messages. Can you share your Mathematica notebook file?

NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.`. >>

Regards Soumen

POSTED BY: Soumen Basak

After correcting works fine: enter image description here

Attachments:
POSTED BY: Mariusz Iwaniuk
Posted 6 years ago

Now I have made all the corrections. It is working fine. Thank you once again. Can you please let me know the way to animate the curve ? E.g. a solid circle is moving and as it moves forward a red lines is drawn. Hope I am clear enough.

Soumen

POSTED BY: Soumen Basak

enter image description here

Attachments:
POSTED BY: Mariusz Iwaniuk
Posted 6 years ago

Dear Mariusz, Thank you once again. The animation that you shared in your past post is exactly what I wanted. However, I am unable to reproduce the same using the mathematica notebook ("testplot ver2.nb"). It does not show the black dot and the curve near the point (x=1,y=0) fluctuates. Do you have any idea about the origin of this problem ? Kindly confirm if you have the correct notebook file.

Regards Soumen

POSTED BY: Soumen Basak

I corrected Mathematica notebook.

In Animate function we can't start T from 0, because Mathematica gives error message.

Workaround is gives a very small number (10^-15).

Attachments:
POSTED BY: Mariusz Iwaniuk

The S was left out of NDSolve. I don't understand the error msg.

POSTED BY: Frank Kampas

After correcting a typo (NDSolve) I got an error message

NDSolve::derlen: The length of the derivative operator Derivative[2] in (x^\[Prime]\[Prime])[t] is not the same as the number of arguments.
POSTED BY: Frank Kampas
Posted 6 years ago

What was the typo ? Do you understand the message you received ?

POSTED BY: Soumen Basak

Hi, maybe you can apply the programming concepts from the Trott Springs Example?

POSTED BY: Raspi Rascal
Posted 6 years ago

Thanks for your response. I shall go through the Trott Springs example. However, I have not yet found any mistake in the Mathematica notebook that I attached with the previous post. Do you see any obvious mistake in that script?

POSTED BY: Soumen Basak
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract