View Single Post
  #4   Spotlight this post!  
Unread 29-12-2016, 00:10
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,494
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: numerical solution of differential equations

The key to efficiently numerically solving this sort of differential equation is to understand the size/scale of the various derivatives. If the second derivative is consistently small, a linear (simple Euler) integration can provide a decent prediction at a reasonably large range step. As the second derivative increases, the range step must be reduced and/or the second derivative must be included in the calculation for each range step; midpoint is one way to do this. If the third derivative is large, you need to make the steps even smaller! Fortunately, the importance of the nth derivative is scaled by 1/n!, that is, the reciprocal of n factorial (google Taylor Expansion if you aren't familiar with it).

If you want an extreme case to work with that has a simple analytic solution, try this one:
x''(t) = 2x + 2x3
Initial conditions: x(0) = 0, x'(0) = 1.
The analytic solution is simply:
x=tan t
x'=sec2t
x''=2 tant sec2t = 2tant + 2tan3t= 2x + 2x3
Using a fixed step size in t, and a finite number of terms in the Taylor expansion with Euler-like integration, the numeric solution will never reach infinity, whereas the analytic solution reaches infinity at pi/2. Try to find solutions and step sizes which suitably predict pi/2, based on x being greater than, say, 10100.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.

Last edited by GeeTwo : 29-12-2016 at 00:13.
Reply With Quote