Simulation
Simulation
Differential Equations
Most general form:
- is the state vector
- is the input vector
xfxu is the derivative of x with respect to time. Tangent to solution curve
Approximating Integral Curves
Vector Field
Integral Curves
泰勒展开,保留三次倒数的项
Euler’s Method
Numerical Integration
Euler’s Method
General Form (Euler Integration):
Some issues associated with numerical integration
- Stability
- Accuracy
- Convergence
- Performanc
some common numerical integration methods that address some of these issues
- 2nd Order Runge-Kutta
- Adams-Bashforth
- 4th Order Runge-Kutta
- Implicit Euler
Runge Kutta
Predictor/Corrector Method
Predict value of at time using Euler Integration
Then use to evaluate
Now average And
2nd Order
where
4th Order
where
Stiff Dynamic Systems
Stiff Systems
- System dynamics contain high frequency oscillations and rapidly decaying responses
Smaller time steps required to accurately simulate the system dynamics
Often seen in systems with stiff springs
- clothing simulation
- fluid simulation
Implicit Integration Methods
Explicit Euler methods add energy in the form of errors
- This is bad for stiff systems
- Can result in instability
Implicit Euler methods removes energy
- Better for Stiff Systems
Backwards Euler:
Implicit Methods
- Result of backwards Euler
- Solution converges more slowly
- But it converges!
Problem with Implicit Euler
- How to compute
- Derive from formula (most accurate)
- Compute using explicit method and plug in value (predictor-corrector)
- Solve using linear system (slowest, most general)
Multi-step Methods
Previous methods used only values from the current and next time step
Idea: approximation drifts more the further we get from initial value
Use values from previous time steps to calculate next one
Anchors approximation with more accurate data
- Adams Bashforth
- Verlet Integration