Mathematica Problem - Help Solving Differential Eqns

  • Context: Mathematica 
  • Thread starter Thread starter bruce999
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

The discussion focuses on solving differential equations using Mathematica, specifically addressing the use of the FindRoot function. The user encountered issues with recognizing the solution Phi(t) due to improper rule assignment. The solution involves modifying the code to include the rule output from NDSolve, specifically using FindRoot[Phi(t)/.simpletreb,{t,.2}]. This adjustment allows for accurate identification of the x-axis crossing point.

PREREQUISITES
  • Basic understanding of differential equations
  • Familiarity with Mathematica version 12.3
  • Knowledge of NDSolve function in Mathematica
  • Experience with FindRoot function in Mathematica
NEXT STEPS
  • Explore advanced features of NDSolve in Mathematica
  • Learn about rule assignment and pattern matching in Mathematica
  • Investigate plotting solutions of differential equations in Mathematica
  • Study the use of FindRoot for solving nonlinear equations in Mathematica
USEFUL FOR

Students and researchers in mathematics, engineers working with differential equations, and anyone new to using Mathematica for computational problem-solving.

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: 595
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

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K