Mathematica NDSolve different solutions same eq's

  • Mathematica
  • Thread starter Vrbic
  • Start date
  • Tags
    Mathematica
In summary, the speaker is having trouble with Mathematica while working with Lagrangians of certain systems. They have found a "central problem" where their procedure in Mathematica solves two equations of second order, but when solved by hand, the second equation becomes reduced to ## \delta_t (mr^2 \phi)=0 ## and they introduce a constant of angular momentum ##L##. However, when they let Mathematica solve the general equation without introducing ##L##, they get a different solution. The speaker has realized that the initial conditions for the two equations are not the same, but they are unsure why this is the case. They are seeking advice on how to resolve this issue.
  • #1
Vrbic
407
18
Hello, I have peculiar trouble with mathematica. I'm playing with lagrangians of some systems and I hit on "central problem". If I use my procedure in mathematica it solve 2 eq. of second order. But if you solve it by hand, you know, ##\phi## coord is "cyclic". And second eq. is reduced to ## \delta_t (mr^2 \phi)=0 ## and we introduce constant of angular momentum ##L##.
And the problem: If I let solve mathematica general equation without introduction ##L## I get another solution than if I transform second equation by introduction ##L##
(different eq.'s: ##2mr\phi'+mr^2\phi''=0## and ##mr^2\phi'=L##)
I used same initial condition.
Could you somebody advise where is the problem or how to resolve it?
 
Physics news on Phys.org
  • #2
My bad, I found out that, the initial conditions aren't same. But it is for me still mystery. Why for this two same eq.'s in different forms, the initial conditions setted in same way aren't same?
 
  • #3
As far as I can tell they are not the same equation.
 

1. What is NDSolve in Mathematica?

NDSolve is a function in the Mathematica software that is used to solve differential equations numerically. It takes in the equation, initial conditions, and any other parameters as input and returns a solution in the form of an interpolating function.

2. Why do I get different solutions for the same equation in NDSolve?

There are several reasons why you may get different solutions for the same equation in NDSolve. One possible reason is that the equation is a nonlinear one and may have multiple solutions. Another reason could be due to the choice of initial conditions or parameters, as these can greatly affect the behavior of the solution. Additionally, the method and settings used in NDSolve can also impact the solution obtained.

3. How can I determine which solution is the most accurate in NDSolve?

To determine the accuracy of a solution obtained from NDSolve, you can use the "AccuracyGoal" and "PrecisionGoal" options when calling the function. These options allow you to specify the desired level of accuracy and precision for the solution. You can also compare the solution obtained with other methods or with analytical solutions, if available.

4. Can NDSolve handle systems of differential equations?

Yes, NDSolve is capable of solving systems of differential equations. It can handle both coupled and uncoupled systems, as well as systems with non-constant coefficients. You can specify the system of equations as a list of equations or using the notation of a vector differential equation.

5. Are there any limitations to using NDSolve in Mathematica?

Although NDSolve is a powerful tool for solving differential equations, there are some limitations to its use. It may struggle with stiff equations or equations that have discontinuities. Additionally, NDSolve may not be able to find a solution if the equation is ill-posed or if the initial conditions are not specified correctly. It is important to carefully consider the properties of the equation and the chosen settings when using NDSolve.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
148
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
271
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
6
Views
634
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Back
Top