Mathematica Problem - Help Solving Differential Eqns

  • Mathematica
  • Thread starter bruce999
  • Start date
  • Tags
    Mathematica
In summary, the individual is new to using Mathematica for solving differential equations and has successfully plotted a simple equation. They have been struggling to use the FindRoot function to find the point where the equation crosses the x-axis. The solution to their problem is to include the rule for Phi(t) every time they want Mathematica to recognize it as the solution. They have now solved the problem and are grateful for the help.
  • #1
bruce999
11
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: 500
Physics news on Phys.org
  • #2
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}]
 
  • #3
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:
 

Related to Mathematica Problem - Help Solving Differential Eqns

1. How can I solve a differential equation using Mathematica?

Mathematica has built-in functions for solving differential equations, such as DSolve and NDSolve. You can also use the Wolfram Language to define your own equations and use numerical methods to solve them.

2. Can Mathematica solve any type of differential equation?

Mathematica can solve a wide range of differential equations, including ordinary differential equations (ODEs), partial differential equations (PDEs), and systems of equations.

3. How do I plot the solution of a differential equation in Mathematica?

After using DSolve or NDSolve to obtain the solution, you can use the Plot function to graph the solution over a specified range of values. You can also use the Manipulate function to create an interactive plot.

4. Is there a way to check the accuracy of the solution to a differential equation in Mathematica?

Yes, you can use the Evaluate function to compare the numerical solution obtained from NDSolve to the exact solution obtained from DSolve. You can also use the AccuracyGoal and PrecisionGoal options in NDSolve to specify the desired level of accuracy.

5. Can Mathematica solve differential equations with initial or boundary conditions?

Yes, Mathematica can solve differential equations with initial or boundary conditions using the method of undetermined coefficients. You can specify the initial or boundary conditions in the syntax of the DSolve or NDSolve functions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
534
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
5K
Back
Top