# Discrete-Time Dynamics
# "Explicit" Form
- is the "discrete" dynamics.
# Simplest Discretization: Forward Euler Integration
- : time step
# Pendulum Simulation
- (blows up)
# Stability of Discrete-Time Systems
-
In continuous time: stable.
-
In discrete time, dynamics is an iterated map:
-
Linearize + apply chain rule:
-
Assume equilibrium is at :
Stable
(inside unit circle in complex plane)
# Applying to Pendulum + Forward Euler:
- (for )
- Plot vs. : only (marginally) stable in the limit .
# Intuition:
Linear approximation always overshoots .
[Image showing forward euler overshooting a sine wave curve]
# Takeaway Message:
- Be careful when discretizing ODEs.
- Sanity check based on energy, momentum, etc. (Conservation and/or dissipation).
- Don't use Forward Euler integration.
# Advanced Numerical Integration and Control Discretization
# A Better Explicit Integrator
While Forward Euler is simple, it often lacks the necessary accuracy for complex systems.
-
4th Order Runge-Kutta Method (RK4): The "industry standard" for explicit integration.
-
Intuition:
- Euler fits a line segment over each timestep.
- RK4 fits a cubic polynomial much better accuracy!
- Pseudo-code:
Takeaway: The accuracy win far outweighs the additional computational cost. However, even sophisticated integrators have issues—always sanity check your results!
# "Implicit" Form
Unlike explicit methods, implicit methods define the future state as a function of itself.
- Form:
- Simplest Version: Backward Euler
(Evaluates at the future time) - How do we simulate?
- Write as:
- Solve a root-finding problem for (e.g., using Newton's method).
- Pendulum Simulation:
- Opposite energy behavior from Forward Euler.
- Discretization adds numerical damping.
- While technically "unphysical," this effect allows simulators to take big steps and remain stable, which is often convenient.
- Very common in "low-fi" simulators in graphics and robotics.
Takeaway: Implicit methods are often "more stable" than Forward Euler. While solving the implicit equation is more expensive for forward simulation, they are not more expensive in many "direct" control methods.
# Discretizing Controls
So far, we have discretized the state . We also need to discretize the control input .
# 1. Simplest Option: Zero-Order Hold (ZOH)
for
- Pros: Easy to implement.
- Cons: May require many "knot points" to accurately capture a continuous .
# 2. Better Option: First-Order Hold (FOH)
- Can approximate continuous with fewer knot points.
- Not much extra work compared to ZOH.
- Super common (e.g., classic DIRCOL - Direct Collocation).
