类 ComplexODEConverter
复杂常微分方程
into 实数方程
.
This class is a wrapper around a ComplexOrdinaryDifferentialEquation
which allow to use a ODEIntegrator
to integrate it.
The transformation is done by changing the n dimension state vector to a 2n dimension vector, where the even components are real parts and odd components are imaginary parts.
One should be aware that the data is duplicated during the transformation process and that for each call to computeDerivatives
, this wrapper does copy 4n scalars : 2n before the call to computeDerivatives
in order to dispatch the y state vector, and 2n after the call to gather zDot. Since the underlying problem by itself perhaps also needs to copy data and dispatch the arrays into domain objects, this has an impact on both memory and CPU usage. The only way to avoid this duplication is to perform the transformation at the problem level, i.e. to implement the problem as a first order one and then avoid using this class.
The proper way to use the converter is as follows:
ODEIntegrator integrator = ...build some integrator...; ComplexOrdinaryDifferentialEquation complexEquations = ...set up the complex problem...; ComplexODEState initialState = ...set up initial state...; ComplexODEConverter converter = new ComplexODEConverter(); ComplexODEStateAndDerivative finalstate = converter.convertStateAndDerivative(integrator.integrate(converter.convertEquations(complexEquations), converter.convertState(initialState), t);
If there are 复杂次要方程
, they must be converted too and both the converted primary equations and converted secondary equations must be combined together using ExpandableODE
as usual for regular real equations.
- 从以下版本开始:
- 1.4
- 另请参阅:
-
构造器概要
-
方法概要
修饰符和类型方法说明转换方程集。convertSecondaryEquations
(ComplexSecondaryODE equations) 转换次要方程集。convertState
(ComplexODEState state) 转换复杂状态(通常是初始状态)。转换实数状态和导数(通常是最终状态或用于步骤处理或事件处理的某些中间状态)。
-
构造器详细资料
-
ComplexODEConverter
public ComplexODEConverter()空构造函数。这个构造函数并非绝对必要,但它可以防止在JDK 18及更高版本中出现不必要的javadoc警告。
- 从以下版本开始:
- 3.0
-
-
方法详细资料
-
convertEquations
转换方程集。- 参数:
-
equations
- 要转换的方程 - 返回:
- 转换后的方程
-
convertSecondaryEquations
转换次要方程集。- 参数:
-
equations
- 要转换的方程 - 返回:
- 转换后的方程
-
convertState
转换复杂状态(通常是初始状态)。- 参数:
-
state
- 要转换的状态 - 返回:
- 转换后的状态
-
convertState
转换实数状态和导数(通常是最终状态或用于步骤处理或事件处理的某些中间状态)。- 参数:
-
state
- 要转换的状态 - 返回:
- 转换后的状态
-