diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6521f7f93..c12a2a6cc 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -78,6 +78,10 @@ Users are encouraged to upgrade to this version as this release not 2. A few methods in the FastMath class are in fact slower that their counterpart in either Math or StrictMath (cf. MATH-740 and MATH-901). "> + + Fixed missing side effects of secondary equations on main state in + Ordinary Differential Equations integration. + Fixed inverse cumulative probability for uniform distribution. diff --git a/src/main/java/org/apache/commons/math3/ode/ExpandableStatefulODE.java b/src/main/java/org/apache/commons/math3/ode/ExpandableStatefulODE.java index fe918537f..842e58286 100644 --- a/src/main/java/org/apache/commons/math3/ode/ExpandableStatefulODE.java +++ b/src/main/java/org/apache/commons/math3/ode/ExpandableStatefulODE.java @@ -117,7 +117,6 @@ public class ExpandableStatefulODE { // compute derivatives of the primary equations primaryMapper.extractEquationData(y, primaryState); primary.computeDerivatives(t, primaryState, primaryStateDot); - primaryMapper.insertEquationData(primaryStateDot, yDot); // Add contribution for secondary equations for (final SecondaryComponent component : components) { @@ -127,6 +126,8 @@ public class ExpandableStatefulODE { component.mapper.insertEquationData(component.stateDot, yDot); } + primaryMapper.insertEquationData(primaryStateDot, yDot); + } /** Add a set of secondary equations to be integrated along with the primary set.