diff --git a/include/amici/abstract_model.h b/include/amici/abstract_model.h index d80a213e9f..56b54eaceb 100644 --- a/include/amici/abstract_model.h +++ b/include/amici/abstract_model.h @@ -357,12 +357,10 @@ class AbstractModel { * @param k constant vector * @param h Heaviside vector * @param w repeating elements vector - * @param dwdx Recurring terms in xdot, state derivative */ virtual void fdydx( realtype* dydx, realtype t, realtype const* x, realtype const* p, - realtype const* k, realtype const* h, realtype const* w, - realtype const* dwdx + realtype const* k, realtype const* h, realtype const* w ); /** diff --git a/models/model_calvetti_py/dydx.cpp b/models/model_calvetti_py/dydx.cpp index 8bacfcc05d..23280d05fa 100644 --- a/models/model_calvetti_py/dydx.cpp +++ b/models/model_calvetti_py/dydx.cpp @@ -6,12 +6,11 @@ #include "k.h" #include "h.h" #include "w.h" -#include "dwdx.h" namespace amici { namespace model_model_calvetti_py { -void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[0] = 1; dydx[3] = std::pow(L1, 3)*(2*f1/R1 - 2*(R3*f3 + f1*(R1 + R2) + f2*(R2 + R3))/std::pow(R1, 2) + 4/std::pow(R1, 2))/std::pow(V1, 3); dydx[7] = 1; diff --git a/models/model_calvetti_py/model_calvetti_py.h b/models/model_calvetti_py/model_calvetti_py.h index d18deb259f..834ebef1b7 100644 --- a/models/model_calvetti_py/model_calvetti_py.h +++ b/models/model_calvetti_py/model_calvetti_py.h @@ -57,7 +57,7 @@ extern void dxdotdw_rowvals_model_calvetti_py(SUNMatrixWrapper &rowvals); extern void dxdotdx_explicit_model_calvetti_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w); extern void dxdotdx_explicit_colptrs_model_calvetti_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_calvetti_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); @@ -309,8 +309,8 @@ class Model_model_calvetti_py : public amici::Model_DAE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_calvetti_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_calvetti_py(dydx, t, x, p, k, h, w); } diff --git a/models/model_dirac_py/dydx.cpp b/models/model_dirac_py/dydx.cpp index 8c7f99fbb9..161f78c3e5 100644 --- a/models/model_dirac_py/dydx.cpp +++ b/models/model_dirac_py/dydx.cpp @@ -9,7 +9,7 @@ namespace amici { namespace model_model_dirac_py { -void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[1] = 1; } diff --git a/models/model_dirac_py/model_dirac_py.h b/models/model_dirac_py/model_dirac_py.h index caef0fb751..5152cc2ff6 100644 --- a/models/model_dirac_py/model_dirac_py.h +++ b/models/model_dirac_py/model_dirac_py.h @@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_dirac_py(SUNMatrixWrapper &rowvals); extern void dxdotdx_explicit_model_dirac_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dxdotdx_explicit_colptrs_model_dirac_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_dirac_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); @@ -300,8 +300,8 @@ class Model_model_dirac_py : public amici::Model_ODE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_dirac_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_dirac_py(dydx, t, x, p, k, h, w); } diff --git a/models/model_events_py/dydx.cpp b/models/model_events_py/dydx.cpp index 6334475430..ee84fc2bac 100644 --- a/models/model_events_py/dydx.cpp +++ b/models/model_events_py/dydx.cpp @@ -10,7 +10,7 @@ namespace amici { namespace model_model_events_py { -void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[0] = p4; dydx[1] = p4; dydx[2] = p4; diff --git a/models/model_events_py/model_events_py.h b/models/model_events_py/model_events_py.h index 1995371f93..5a03c91a22 100644 --- a/models/model_events_py/model_events_py.h +++ b/models/model_events_py/model_events_py.h @@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_events_py(SUNMatrixWrapper &rowvals); extern void dxdotdx_explicit_model_events_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dxdotdx_explicit_colptrs_model_events_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_events_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dydp_model_events_py(realtype *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *tcl, const realtype *dtcldp, const realtype *spl, const realtype *sspl); extern void dzdx_model_events_py(realtype *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); @@ -319,8 +319,8 @@ class Model_model_events_py : public amici::Model_ODE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_events_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_events_py(dydx, t, x, p, k, h, w); } diff --git a/models/model_jakstat_adjoint_py/dydx.cpp b/models/model_jakstat_adjoint_py/dydx.cpp index c7038c3879..f58e5711b0 100644 --- a/models/model_jakstat_adjoint_py/dydx.cpp +++ b/models/model_jakstat_adjoint_py/dydx.cpp @@ -10,7 +10,7 @@ namespace amici { namespace model_model_jakstat_adjoint_py { -void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[1] = scale_tSTAT/init_STAT; dydx[3] = scale_pSTAT/init_STAT; dydx[4] = scale_tSTAT/init_STAT; diff --git a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h index 19454c9f24..8f9e90b82e 100644 --- a/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h +++ b/models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h @@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_jakstat_adjoint_py(SUNMatrixWrapper & extern void dxdotdx_explicit_model_jakstat_adjoint_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dxdotdx_explicit_colptrs_model_jakstat_adjoint_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_jakstat_adjoint_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dydp_model_jakstat_adjoint_py(realtype *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *tcl, const realtype *dtcldp, const realtype *spl, const realtype *sspl); @@ -308,8 +308,8 @@ class Model_model_jakstat_adjoint_py : public amici::Model_ODE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_jakstat_adjoint_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_jakstat_adjoint_py(dydx, t, x, p, k, h, w); } diff --git a/models/model_nested_events_py/dydx.cpp b/models/model_nested_events_py/dydx.cpp index ac803f6931..f7f4c7f044 100644 --- a/models/model_nested_events_py/dydx.cpp +++ b/models/model_nested_events_py/dydx.cpp @@ -9,7 +9,7 @@ namespace amici { namespace model_model_nested_events_py { -void dydx_model_nested_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_nested_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[0] = 1; } diff --git a/models/model_nested_events_py/model_nested_events_py.h b/models/model_nested_events_py/model_nested_events_py.h index 6925d8df34..1406e3da07 100644 --- a/models/model_nested_events_py/model_nested_events_py.h +++ b/models/model_nested_events_py/model_nested_events_py.h @@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_nested_events_py(SUNMatrixWrapper &ro extern void dxdotdx_explicit_model_nested_events_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dxdotdx_explicit_colptrs_model_nested_events_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_nested_events_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_nested_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_nested_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); @@ -304,8 +304,8 @@ class Model_model_nested_events_py : public amici::Model_ODE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_nested_events_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_nested_events_py(dydx, t, x, p, k, h, w); } diff --git a/models/model_neuron_py/dydx.cpp b/models/model_neuron_py/dydx.cpp index 5854c7726e..fe3c61f9f6 100644 --- a/models/model_neuron_py/dydx.cpp +++ b/models/model_neuron_py/dydx.cpp @@ -10,7 +10,7 @@ namespace amici { namespace model_model_neuron_py { -void dydx_model_neuron_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_neuron_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[0] = 1; } diff --git a/models/model_neuron_py/model_neuron_py.h b/models/model_neuron_py/model_neuron_py.h index 4d35a8a443..9c90582736 100644 --- a/models/model_neuron_py/model_neuron_py.h +++ b/models/model_neuron_py/model_neuron_py.h @@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_neuron_py(SUNMatrixWrapper &rowvals); extern void dxdotdx_explicit_model_neuron_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dxdotdx_explicit_colptrs_model_neuron_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_neuron_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_neuron_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_neuron_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dzdx_model_neuron_py(realtype *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); @@ -316,8 +316,8 @@ class Model_model_neuron_py : public amici::Model_ODE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_neuron_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_neuron_py(dydx, t, x, p, k, h, w); } diff --git a/models/model_robertson_py/dydx.cpp b/models/model_robertson_py/dydx.cpp index 3fdd467ad8..50f1b062c9 100644 --- a/models/model_robertson_py/dydx.cpp +++ b/models/model_robertson_py/dydx.cpp @@ -9,7 +9,7 @@ namespace amici { namespace model_model_robertson_py { -void dydx_model_robertson_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_robertson_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[0] = 1; dydx[4] = 10000.0; dydx[8] = 1; diff --git a/models/model_robertson_py/model_robertson_py.h b/models/model_robertson_py/model_robertson_py.h index 591f64acf9..6e91cfd829 100644 --- a/models/model_robertson_py/model_robertson_py.h +++ b/models/model_robertson_py/model_robertson_py.h @@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_robertson_py(SUNMatrixWrapper &rowval extern void dxdotdx_explicit_model_robertson_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w); extern void dxdotdx_explicit_colptrs_model_robertson_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_robertson_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_robertson_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_robertson_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); @@ -292,8 +292,8 @@ class Model_model_robertson_py : public amici::Model_DAE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_robertson_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_robertson_py(dydx, t, x, p, k, h, w); } diff --git a/models/model_steadystate_py/dydx.cpp b/models/model_steadystate_py/dydx.cpp index 91b5853abe..554039f1f2 100644 --- a/models/model_steadystate_py/dydx.cpp +++ b/models/model_steadystate_py/dydx.cpp @@ -9,7 +9,7 @@ namespace amici { namespace model_model_steadystate_py { -void dydx_model_steadystate_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){ +void dydx_model_steadystate_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){ dydx[0] = 1; dydx[4] = 1; dydx[8] = 1; diff --git a/models/model_steadystate_py/model_steadystate_py.h b/models/model_steadystate_py/model_steadystate_py.h index 3e2429a109..1e6243b822 100644 --- a/models/model_steadystate_py/model_steadystate_py.h +++ b/models/model_steadystate_py/model_steadystate_py.h @@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_steadystate_py(SUNMatrixWrapper &rowv extern void dxdotdx_explicit_model_steadystate_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); extern void dxdotdx_explicit_colptrs_model_steadystate_py(SUNMatrixWrapper &colptrs); extern void dxdotdx_explicit_rowvals_model_steadystate_py(SUNMatrixWrapper &rowvals); -extern void dydx_model_steadystate_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); +extern void dydx_model_steadystate_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); @@ -292,8 +292,8 @@ class Model_model_steadystate_py : public amici::Model_ODE { } - void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - dydx_model_steadystate_py(dydx, t, x, p, k, h, w, dwdx); + void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { + dydx_model_steadystate_py(dydx, t, x, p, k, h, w); } diff --git a/python/sdist/amici/_codegen/cxx_functions.py b/python/sdist/amici/_codegen/cxx_functions.py index 574093e60a..5151df84a4 100644 --- a/python/sdist/amici/_codegen/cxx_functions.py +++ b/python/sdist/amici/_codegen/cxx_functions.py @@ -78,7 +78,8 @@ def get_deps(self, ode: bool) -> list[str]: ) def var_in_signature(self, varname: str, ode: bool = True) -> bool: - """Check if a variable is in the function signature. + """ + Check if a variable is in the function signature as input (``const``). :param varname: name of the variable to check :param ode: whether to check the ODE (``True``) or DAE (``False``) @@ -225,7 +226,7 @@ def var_in_signature(self, varname: str, ode: bool = True) -> bool: "dydx": _FunctionInfo( "realtype *dydx, const realtype t, const realtype *x, " "const realtype *p, const realtype *k, const realtype *h, " - "const realtype *w, const realtype *dwdx", + "const realtype *w" ), "dydp": _FunctionInfo( "realtype *dydp, const realtype t, const realtype *x, " @@ -483,6 +484,6 @@ def var_in_function_signature(name: str, varname: str, ode: bool) -> bool: :return: boolean indicating whether the variable occurs in the function - signature + signature as ``const`` input. """ return name in functions and functions[name].var_in_signature(varname, ode) diff --git a/python/sdist/amici/de_model.py b/python/sdist/amici/de_model.py index 9666847204..f722558945 100644 --- a/python/sdist/amici/de_model.py +++ b/python/sdist/amici/de_model.py @@ -2147,16 +2147,15 @@ def sym_or_eq(self, name: str, varname: str) -> sp.Matrix: the variable symbols if the variable is part of the signature and the variable equations otherwise. """ - # dwdx and dwdp will be dynamically computed and their ordering - # within a column may differ from the initialization of symbols here, - # so those are not safe to use. Not removing them from signature as - # this would break backwards compatibility. - if var_in_function_signature( - name, varname, self.is_ode() - ) and varname not in [ - "dwdx", - "dwdp", - ]: + if var_in_function_signature(name, varname, self.is_ode()): + if varname in [ + "dwdx", + "dwdp", + ]: + # dwdx and dwdp will be dynamically computed, and their + # ordering within a column may differ from the initialization + # of symbols here, so those are not safe to use. + raise AssertionError() return self.sym(varname) else: return self.eq(varname) diff --git a/src/abstract_model.cpp b/src/abstract_model.cpp index 351314967c..3c8ba018b6 100644 --- a/src/abstract_model.cpp +++ b/src/abstract_model.cpp @@ -97,7 +97,7 @@ void AbstractModel::fdydp( void AbstractModel::fdydx( realtype* /*dydx*/, realtype const /*t*/, realtype const* /*x*/, realtype const* /*p*/, realtype const* /*k*/, realtype const* /*h*/, - realtype const* /*w*/, realtype const* /*dwdx*/ + realtype const* /*w*/ ) { throw AmiException( "Requested functionality is not supported as %s is " diff --git a/src/model.cpp b/src/model.cpp index 3c16109e0b..4cac939f6e 100644 --- a/src/model.cpp +++ b/src/model.cpp @@ -2084,11 +2084,10 @@ void Model::fdydx(realtype const t, AmiVector const& x) { derived_state_.dydx_.assign(ny * nx_solver, 0.0); fw(t, x_pos, false); - fdwdx(t, x_pos, false); fdydx( derived_state_.dydx_.data(), t, x_pos, state_.unscaledParameters.data(), state_.fixedParameters.data(), state_.h.data(), - derived_state_.w_.data(), derived_state_.dwdx_.data() + derived_state_.w_.data() ); if (always_check_finite_) {