Mathematica Mathematica Problem - Help Solving Differential Eqns

  • Thread starter Thread starter bruce999
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The discussion centers on using Mathematica for solving differential equations, specifically focusing on the challenges faced by a new user in finding the x-axis intersection point using the FindRoot function. The key issue identified is that Mathematica requires explicit rules to be applied each time a solution is referenced. The solution involves using the substitution rule correctly by incorporating it into the FindRoot function. The user is advised to modify their code to include the substitution, which resolves the problem they were experiencing. Overall, the exchange highlights the importance of understanding how Mathematica handles variable assignments and rules in solving equations.
bruce999
Messages
11
Reaction score
1
I'm very new to mathematica and have been trying to use it for solving differential eqns. I've done a simple equation and managed to do a plot of it which looks correct. All day I've been trying to get findroot to work so i can find the exact point at which it crosses the x-axis but keep having problems. Attached is a screenshot of what I've done. If anyone can help i'd appreciate it.
 

Attachments

  • findroot problem.JPG
    findroot problem.JPG
    30.6 KB · Views: 562
Physics news on Phys.org
Fortunately for you and I, the problem is as simple as could be: In mathematica, rules only assign values during the instance you use them. What I mean is, everytime you want mathematica to recognize Phi(t) as the solution to your differential equation, you have to include

Phi(t)/.Simpletreb

NDSolve gives a rule as output. You named the rule simpletreb (sp?). What I mean is that your must change your code to this:

FindRoot[Phi(t)/.simpletreb,{t,.2}]
 
Thanks a lot! Very much appreciated. You can tell I'm new to this. I've been trying everything for days now. Problem solved! :smile:
 

Similar threads

Back
Top