Solve ODEs w/ Mathematica & Compute Derivative of Niles

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

This discussion focuses on solving a system of ordinary differential equations (ODEs) using Mathematica. The specific ODEs presented are dx/dt = v and dv/dt = a = C*f(x), where C is a constant and f(x) is a function of x. The user seeks to express the derivative x'[t] as a function of x, which requires inverting the solution x[t] to find t[x]. For numerical solutions, the recommended approach is to utilize the FindRoot function in Mathematica to achieve this inversion.

PREREQUISITES
  • Understanding of ordinary differential equations (ODEs)
  • Familiarity with Mathematica's NDSolve function
  • Knowledge of function inversion techniques
  • Experience with Mathematica's FindRoot function
NEXT STEPS
  • Explore the use of Mathematica's NDSolve for solving complex ODE systems
  • Learn about function inversion methods in Mathematica
  • Investigate the FindRoot function for numerical root-finding
  • Study analytic versus numerical solutions in the context of ODEs
USEFUL FOR

Mathematicians, physicists, and engineers working with differential equations, as well as Mathematica users seeking to solve and manipulate ODEs effectively.

Niles
Messages
1,834
Reaction score
0
Hi

I have a system of ODEs of the form

dx/dt = v
dv/dt = a = C*f(x),

where C denotes a constant and f(x) is some function of x. This system is easy to solve using (e.g.)
Code:
NDSolve[x''[t] == C*f(x), x[0] == 0, x'[0] == 0}, x, {t, 0, tMax}];
I need to use the derivative of the solution x[t], x'[t], in the following expression: B(x) = A + v(x), where A denotes a constant. But please note that the derivative is needed as a function of x, not t. I've been trying to figure out a smart way to do this, but I can't wrap my head around this. What should I do to achieve this?Niles.
 
Last edited:
Physics news on Phys.org
Since you have x[t], you need to invert this to find t[x], then, since you know v[t], your v[x] is given by v[t[x]]. If you have an analytic solution, you can do this analytically, but if you have a numerical solution, the easiest way to invert it is probably with FindRoot. See the attached notebook.
 

Attachments

Thanks, that is very kind of you.Niles.
 

Similar threads

Replies
8
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 0 ·
Replies
0
Views
1K