Solving ODE Convergence Problem with Secant Approximation

  • Thread starter Thread starter brydustin
  • Start date Start date
  • Tags Tags
    Convergence Ode
Click For Summary
SUMMARY

The discussion focuses on solving an Ordinary Differential Equation (ODE) convergence problem using secant approximation for the derivative of a time-dependent function S(t). The user aims to evaluate S(t) until the derivative dS/dt approaches zero, but faces inefficiencies and inaccuracies in their current criteria. The secant approximation is defined as [ S(t_{n}) - S(t_{n-1}) ] / [t_{n} - t_{n-1}] < tolerance, with t_{n} - t_{n-1} set to approximately 10^-15. The user is utilizing Python and seeks built-in functions to enhance computation efficiency.

PREREQUISITES
  • Understanding of Ordinary Differential Equations (ODEs)
  • Familiarity with numerical methods, specifically secant approximation
  • Proficiency in Python programming
  • Knowledge of machine precision and its impact on numerical calculations
NEXT STEPS
  • Research Python libraries for numerical analysis, such as SciPy and NumPy
  • Learn about adaptive time-stepping methods for ODEs
  • Explore techniques for normalizing time units in numerical simulations
  • Investigate error analysis in numerical methods to improve precision
USEFUL FOR

Mathematicians, physicists, and engineers working with numerical simulations of ODEs, particularly those seeking to optimize computational efficiency and accuracy in Python.

brydustin
Messages
201
Reaction score
0
I have a pesky problem, I have this function of time, S(t) and I'm trying to find how far to evaluate S (its an expensive process and must be done for finite t=time). Essentially, I want to measure S until dS/dt ≈ 0. But my current criteria is making the computation itself inefficient not to mention it is erroneous -- at times it is satisfied at very early t and at other times as t approaches infinity. Now, in theory the solution "really" only exists as t approaches infinity (i.e. dS/dt = 0, thence we take ≈0)
So currently, my approach has been a secant approximation of the derivative
(i.e. [ S(t_{n}) - S(t_{n-1}) ] / [t_{n} - t_{n-1}] < tolerance )

Where t_{n} - t_{n-1} is roughly 10^-15 (its a small scale because all the dynamics of this ODE happen on short time scales.) The code was constructed in python so if there are already built in functions that can help in my situation that would be nice as well.

All help appreciated!
 
Physics news on Phys.org
With a scale that small, it is likely that you are unable to resolve due to the machine precision of your platform.

Try normalizing your units of time to something much smaller than seconds (assuming that's the unit you're using now).
 

Similar threads

Replies
46
Views
7K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K