BDFOdeSolver
The `BDFOdeSolver` is a velocity-based ODE solver in the SOFA framework that uses the Backward Differentiation Formula (BDF). It supports any order and variable time step sizes, enabling precise control over numerical integration for simulations requiring high accuracy and stability. This component inherits from `BaseLinearMultiStepMethod`, indicating its role within a hierarchy of linear multi-step methods. The `BDFOdeSolver` computes coefficients needed for BDF using Lagrange interpolation polynomials to approximate the derivative at each step. It interacts with other components through the API by providing methods such as `computeLinearMultiStepCoefficients` and `recomputeCoefficients`, which update the solver's internal state based on the current simulation parameters like time steps and order of integration. Practical usage involves configuring the solver’s order and ensuring it is set to a stable value (not exceeding 6) for reliable simulation results.
- abstract
- The `BDFOdeSolver` is a velocity-based ODE solver using the Backward Differentiation Formula (BDF) with support for any order and variable time step sizes.
- sheet
- # BDFOdeSolver ## Overview The `BDFOdeSolver` is a velocity-based ODE solver that uses the Backward Differentiation Formula (BDF). It supports any integration order and allows variable time steps, making it suitable for simulations requiring high accuracy and stability. This component inherits from `BaseLinearMultiStepMethod`, indicating its role in numerical integration within SOFA. ## Mathematical Model The Backward Differentiation Formula (BDF) is used to approximate the derivative at each step using Lagrange interpolation polynomials. For a given order \(k\), the BDF method can be expressed as: egin{equation} y'(t_n) = \sum_{j=0}^{k} \alpha_j y(t_{n-j}) + h \beta_k f(t_n, y(t_n)), \end{equation} where \(y(t_n)\) is the solution at time step \(t_n\), \(h = t_n - t_{n-1}\) is the time step size, and \(f(t_n, y(t_n))\) represents the right-hand side of the ODE. The coefficients \(\alpha_j\) and \(\beta_k\) are computed using Lagrange interpolation polynomials. The method `computeLinearMultiStepCoefficients` calculates these coefficients based on the specified order and time step size, ensuring accurate numerical integration.
- description
- The `BDFOdeSolver` is a velocity-based ODE solver in the SOFA framework that uses the Backward Differentiation Formula (BDF). It supports any order and variable time step sizes, enabling precise control over numerical integration for simulations requiring high accuracy and stability. This component inherits from `BaseLinearMultiStepMethod`, indicating its role within a hierarchy of linear multi-step methods. The `BDFOdeSolver` computes coefficients needed for BDF using Lagrange interpolation polynomials to approximate the derivative at each step. It interacts with other components through the API by providing methods such as `computeLinearMultiStepCoefficients` and `recomputeCoefficients`, which update the solver's internal state based on the current simulation parameters like time steps and order of integration. Practical usage involves configuring the solver’s order and ensuring it is set to a stable value (not exceeding 6) for reliable simulation results.
- mathematical_and_physical_description
-
{ "bdf_method_details": { "coefficients_computation": { "computeLinearMultiStepCoefficients": { "equation": [ "The coefficient $a_j$ is computed as follows:", "$a_j = \\sum_{i=0, i\\neq j}^{order} \\left(\\prod_{m=0, m\\neq i,j}^{order}\\frac{samples[order] - samples[m]}{samples[j] - samples[m]}\\right) / (samples[j] - samples[i])$", "where $j = 0,1,...,order$. The coefficients are then normalized.", "$a_j\u0027 = \\frac{a_j}{a_{order}}$, for all $j \u003c order$ and $b_{order} = \\frac{1}{a_{order}}$" ], "functionality": "Computes the coefficients (`a_coef` and `b_coef`) needed for BDF using Lagrange interpolation polynomials. The polynomial is derived from a set of samples (time points), and the derivative at each step is approximated by evaluating these polynomials." }, "recomputeCoefficients": { "equation": [ "The time step difference is computed as $dt = samples[order] - samples[order-1]$", "The coefficients are then scaled by this time step." ], "functionality": "Updates the solver\u0027s internal state with new coefficients based on the current simulation parameters, such as time step (`dt`) and integration order." } }, "order_support": "Supports BDF of any order (up to 6 for stability).", "stability_check": { "equation": [ "The method with order $\u003e 6$ is not zero-stable." ], "functionality": "Ensures the solver\u0027s order does not exceed 6 to maintain zero-stability. If the configured order is greater than 6, a warning message is logged." } }, "description": "The `BDFOdeSolver` in the SOFA framework employs the Backward Differentiation Formula (BDF) to solve Ordinary Differential Equations (ODEs). This solver is designed for high accuracy and stability, particularly useful in simulations requiring precise control over numerical integration. The BDF method approximates the derivative at each step using Lagrange interpolation polynomials.", "numerical_integration": { "description": "BDF methods are implicit and provide higher-order accuracy while maintaining stability for stiff systems. The BDF of order `k` can be written as:", "equation": [ "$y_{n+1} = \\sum_{i=0}^{k-1} a_i y_n + b_k f(t_{n+1}, y_{n+1})$, where $a_i$ and $b_k$ are the computed coefficients." ] }, "odesolver_role": "The `BDFOdeSolver` inherits from `BaseLinearMultiStepMethod`, indicating its role as a linear multi-step ODE solver. It supports variable time step sizes and can be configured to any order, providing flexibility for different simulation requirements." }
{
"name": "BDFOdeSolver",
"main": {
"name": "BDFOdeSolver",
"namespace": "sofa::component::odesolver::backward",
"module": "Sofa.Component.ODESolver.Backward",
"include": "sofa/component/odesolver/backward/BDFOdeSolver.h",
"doc": "Velocity-based ODE solver using Backward Differentiation Formula (BDF), at any order, supporting variable time step size.",
"inherits": [
"BaseLinearMultiStepMethod"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "computeLinearMultiStepCoefficients",
"return_type": "void",
"params": [
{
"name": "samples",
"type": "const int &"
},
{
"name": "a_coef",
"type": "int &"
},
{
"name": "b_coef",
"type": "int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": true,
"access": "public"
},
{
"name": "recomputeCoefficients",
"return_type": "void",
"params": [
{
"name": "order",
"type": "int"
},
{
"name": "dt",
"type": "SReal"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
}
]
},
"desc": {
"description": "The `BDFOdeSolver` is a velocity-based ODE solver in the SOFA framework that uses the Backward Differentiation Formula (BDF). It supports any order and variable time step sizes, enabling precise control over numerical integration for simulations requiring high accuracy and stability. This component inherits from `BaseLinearMultiStepMethod`, indicating its role within a hierarchy of linear multi-step methods. The `BDFOdeSolver` computes coefficients needed for BDF using Lagrange interpolation polynomials to approximate the derivative at each step. It interacts with other components through the API by providing methods such as `computeLinearMultiStepCoefficients` and `recomputeCoefficients`, which update the solver's internal state based on the current simulation parameters like time steps and order of integration. Practical usage involves configuring the solver’s order and ensuring it is set to a stable value (not exceeding 6) for reliable simulation results."
},
"maths": {
"mathematical_and_physical_description": {
"description": "The `BDFOdeSolver` in the SOFA framework employs the Backward Differentiation Formula (BDF) to solve Ordinary Differential Equations (ODEs). This solver is designed for high accuracy and stability, particularly useful in simulations requiring precise control over numerical integration. The BDF method approximates the derivative at each step using Lagrange interpolation polynomials.",
"odesolver_role": "The `BDFOdeSolver` inherits from `BaseLinearMultiStepMethod`, indicating its role as a linear multi-step ODE solver. It supports variable time step sizes and can be configured to any order, providing flexibility for different simulation requirements.",
"bdf_method_details": {
"order_support": "Supports BDF of any order (up to 6 for stability).",
"coefficients_computation": {
"computeLinearMultiStepCoefficients": {
"functionality": "Computes the coefficients (`a_coef` and `b_coef`) needed for BDF using Lagrange interpolation polynomials. The polynomial is derived from a set of samples (time points), and the derivative at each step is approximated by evaluating these polynomials.",
"equation": [
"The coefficient $a_j$ is computed as follows:",
"$a_j = \\sum_{i=0, i\\neq j}^{order} \\left(\\prod_{m=0, m\\neq i,j}^{order}\\frac{samples[order] - samples[m]}{samples[j] - samples[m]}\\right) / (samples[j] - samples[i])$",
"where $j = 0,1,...,order$. The coefficients are then normalized.",
"$a_j' = \\frac{a_j}{a_{order}}$, for all $j < order$ and $b_{order} = \\frac{1}{a_{order}}$"
]
},
"recomputeCoefficients": {
"functionality": "Updates the solver's internal state with new coefficients based on the current simulation parameters, such as time step (`dt`) and integration order.",
"equation": [
"The time step difference is computed as $dt = samples[order] - samples[order-1]$",
"The coefficients are then scaled by this time step."
]
}
},
"stability_check": {
"functionality": "Ensures the solver's order does not exceed 6 to maintain zero-stability. If the configured order is greater than 6, a warning message is logged.",
"equation": [
"The method with order $> 6$ is not zero-stable."
]
}
},
"numerical_integration": {
"description": "BDF methods are implicit and provide higher-order accuracy while maintaining stability for stiff systems. The BDF of order `k` can be written as:",
"equation": [
"$y_{n+1} = \\sum_{i=0}^{k-1} a_i y_n + b_k f(t_{n+1}, y_{n+1})$, where $a_i$ and $b_k$ are the computed coefficients."
]
}
}
},
"summary": {
"abstract": "The `BDFOdeSolver` is a velocity-based ODE solver using the Backward Differentiation Formula (BDF) with support for any order and variable time step sizes.",
"sheet": "# BDFOdeSolver\n\n## Overview\nThe `BDFOdeSolver` is a velocity-based ODE solver that uses the Backward Differentiation Formula (BDF). It supports any integration order and allows variable time steps, making it suitable for simulations requiring high accuracy and stability. This component inherits from `BaseLinearMultiStepMethod`, indicating its role in numerical integration within SOFA.\n\n## Mathematical Model\nThe Backward Differentiation Formula (BDF) is used to approximate the derivative at each step using Lagrange interpolation polynomials. For a given order \\(k\\), the BDF method can be expressed as:\n\n\begin{equation}\n y'(t_n) = \\sum_{j=0}^{k} \\alpha_j y(t_{n-j}) + h \\beta_k f(t_n, y(t_n)),\n\\end{equation}\nwhere \\(y(t_n)\\) is the solution at time step \\(t_n\\), \\(h = t_n - t_{n-1}\\) is the time step size, and \\(f(t_n, y(t_n))\\) represents the right-hand side of the ODE. The coefficients \\(\\alpha_j\\) and \\(\\beta_k\\) are computed using Lagrange interpolation polynomials.\n\nThe method `computeLinearMultiStepCoefficients` calculates these coefficients based on the specified order and time step size, ensuring accurate numerical integration."
}
}