Mathematica error when solving a DE -- "exceeded RecursionLimit"

In summary, the person is seeking help with solving a given differential equation using Mathematica and plotting it. They have tried using DSolve with different methods and equations, but are still facing difficulties and are asking for suggestions on how to fix the issue. They also mention having a picture of the equation and their Mathematica code attached.
  • #1
Abhisheko07
5
0
Homework Statement:: I don't know where the mistake is happening. I need to solve the give differential equation in mathematica and have to plot it but i am facing problem in doing so.
Can anyone help me in this?
Relevant Equations:: I have attached the picture of equation as well as my mathematica code.

IMG-20210607-WA0020.jpeg
20210608_075359.jpg
 
Physics news on Phys.org
  • #2
not sure, maybe try sol=DSolve[eqn,y[x],x], that is put y[x] there instead of just y.
Also try putting the equation explicitly into the DSolve command, for example like
sol=Dsolve[y''[x]==-y[x],y[x],x]
 
  • #3
What is x. It looks like x is defined somewhere above. Try clearing x first and then re run your code
 

FAQ: Mathematica error when solving a DE -- "exceeded RecursionLimit"

What does the error "exceeded RecursionLimit" mean in Mathematica when solving a differential equation?

This error means that the code has reached its maximum limit for the number of recursive steps it can take while solving the differential equation. This limit is set by default in Mathematica to prevent infinite loops and ensure that the code terminates.

How do I fix the "exceeded RecursionLimit" error in Mathematica?

To fix this error, you can increase the RecursionLimit using the command $RecursionLimit = n, where n is the desired limit. Alternatively, you can rewrite your code to avoid recursive functions or use iterative methods instead.

Why does the "exceeded RecursionLimit" error occur in Mathematica?

This error can occur when solving a complex differential equation that requires a large number of recursive steps. It can also occur if the code contains a recursive function with no termination condition, causing it to run indefinitely.

Can I disable the RecursionLimit in Mathematica?

Yes, you can disable the RecursionLimit by setting it to $RecursionLimit = Infinity. However, this is not recommended as it can cause your code to run indefinitely if it contains a recursive function with no termination condition.

Are there any other ways to solve a differential equation in Mathematica without encountering the "exceeded RecursionLimit" error?

Yes, there are other methods such as using numerical solvers or built-in functions like DSolve or NDSolve that can solve differential equations without encountering this error. It is always good practice to explore different methods and choose the most suitable one for your specific problem.

Similar threads

Replies
3
Views
2K
Replies
1
Views
926
Replies
3
Views
1K
Replies
5
Views
2K
Replies
6
Views
3K
Replies
2
Views
463
Replies
1
Views
2K
Back
Top