diff --git a/.github/workflows/test_matlab.yml b/.github/workflows/test_matlab.yml deleted file mode 100644 index 10cf07565a..0000000000 --- a/.github/workflows/test_matlab.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Matlab -on: - push: - merge_group: - workflow_dispatch: - pull_request: - branches: - - main - - -jobs: - matlab: - name: Matlab - - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v5 - - run: git fetch --prune --unshallow - - - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV - - - name: Install MATLAB - uses: matlab-actions/setup-matlab@v2 - - name: Run script - uses: matlab-actions/run-command@v2 - with: - command: cd matlab; installAMICI; addpath tests; testModels diff --git a/models/model_calvetti/CMakeLists.txt b/models/model_calvetti/CMakeLists.txt deleted file mode 100644 index c685278a4f..0000000000 --- a/models/model_calvetti/CMakeLists.txt +++ /dev/null @@ -1,118 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_calvetti) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/M.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dwdx.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/root.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/w.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_calvetti/JSparse.cpp b/models/model_calvetti/JSparse.cpp deleted file mode 100644 index 843a93ef37..0000000000 --- a/models/model_calvetti/JSparse.cpp +++ /dev/null @@ -1,79 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void JSparse_model_calvetti(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 3; - JSparse->indexvals[2] = 0; - JSparse->indexvals[3] = 1; - JSparse->indexvals[4] = 3; - JSparse->indexvals[5] = 4; - JSparse->indexvals[6] = 0; - JSparse->indexvals[7] = 1; - JSparse->indexvals[8] = 2; - JSparse->indexvals[9] = 3; - JSparse->indexvals[10] = 4; - JSparse->indexvals[11] = 5; - JSparse->indexvals[12] = 0; - JSparse->indexvals[13] = 3; - JSparse->indexvals[14] = 4; - JSparse->indexvals[15] = 0; - JSparse->indexvals[16] = 1; - JSparse->indexvals[17] = 3; - JSparse->indexvals[18] = 4; - JSparse->indexvals[19] = 5; - JSparse->indexvals[20] = 0; - JSparse->indexvals[21] = 1; - JSparse->indexvals[22] = 2; - JSparse->indexvals[23] = 3; - JSparse->indexvals[24] = 4; - JSparse->indexvals[25] = 5; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 2; - JSparse->indexptrs[2] = 6; - JSparse->indexptrs[3] = 12; - JSparse->indexptrs[4] = 15; - JSparse->indexptrs[5] = 20; - JSparse->indexptrs[6] = 26; - JSparse->data[0] = -cj-w[0]*(1.0E2/8.99E2)+dwdx[6]; - JSparse->data[1] = w[0]*(1.0E2/8.99E2)-dwdx[6]+dwdx[7]*(w[23]*w[24]*2.0-w[20]*w[23]*w[24])-w[23]*w[24]*w[25]*dwdx[4]; - JSparse->data[2] = dwdx[16]; - JSparse->data[3] = -cj-w[6]*1.202935161794779E-2+dwdx[19]; - JSparse->data[4] = -dwdx[16]-w[23]*w[24]*w[25]*dwdx[14]; - JSparse->data[5] = w[6]*1.202935161794779E-2-dwdx[19]; - JSparse->data[6] = dwdx[28]; - JSparse->data[7] = dwdx[31]; - JSparse->data[8] = -cj-w[31]*8.196729508204918E-9+dwdx[32]; - JSparse->data[9] = -dwdx[28]-w[23]*w[24]*w[25]*dwdx[26]; - JSparse->data[10] = -dwdx[31]; - JSparse->data[11] = w[31]*8.196729508204918E-9-dwdx[32]; - JSparse->data[12] = dwdx[36]; - JSparse->data[13] = -dwdx[36]-w[23]*w[24]*w[25]*dwdx[34]-1.0; - JSparse->data[14] = 1.0; - JSparse->data[15] = dwdx[40]; - JSparse->data[16] = dwdx[43]; - JSparse->data[17] = -dwdx[40]-w[23]*w[24]*w[25]*dwdx[38]; - JSparse->data[18] = -dwdx[43]-1.0; - JSparse->data[19] = 1.0; - JSparse->data[20] = dwdx[47]; - JSparse->data[21] = dwdx[50]; - JSparse->data[22] = dwdx[52]; - JSparse->data[23] = -dwdx[47]-w[23]*w[24]*w[25]*dwdx[45]; - JSparse->data[24] = -dwdx[50]; - JSparse->data[25] = -dwdx[52]-1.0; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/Jy.cpp b/models/model_calvetti/Jy.cpp deleted file mode 100644 index b4507d41e2..0000000000 --- a/models/model_calvetti/Jy.cpp +++ /dev/null @@ -1,39 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void Jy_model_calvetti(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; - case 1: - nllh[0] = amici::log((sigmay[1]*sigmay[1])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*5.0E-1; - break; - case 2: - nllh[0] = amici::log((sigmay[2]*sigmay[2])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*5.0E-1; - break; - case 3: - nllh[0] = amici::log((sigmay[3]*sigmay[3])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[3]*sigmay[3])*pow(my[3]-y[3],2.0)*5.0E-1; - break; - case 4: - nllh[0] = amici::log((sigmay[4]*sigmay[4])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[4]*sigmay[4])*pow(my[4]-y[4],2.0)*5.0E-1; - break; - case 5: - nllh[0] = amici::log((sigmay[5]*sigmay[5])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[5]*sigmay[5])*pow(my[5]-y[5],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/M.cpp b/models/model_calvetti/M.cpp deleted file mode 100644 index 32bfd132d6..0000000000 --- a/models/model_calvetti/M.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void M_model_calvetti(realtype *M, const realtype t, const realtype *x, const realtype *p, const realtype *k) { - M[0+0*6] = 1.0; - M[1+1*6] = 1.0; - M[2+2*6] = 1.0; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/dJydsigma.cpp b/models/model_calvetti/dJydsigma.cpp deleted file mode 100644 index 08aa3f3ac3..0000000000 --- a/models/model_calvetti/dJydsigma.cpp +++ /dev/null @@ -1,39 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void dJydsigma_model_calvetti(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0+0*1] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*-1.0+1.0/sigmay[0]; - break; - case 1: - dJydsigma[0+1*1] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*-1.0+1.0/sigmay[1]; - break; - case 2: - dJydsigma[0+2*1] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*-1.0+1.0/sigmay[2]; - break; - case 3: - dJydsigma[0+3*1] = 1.0/(sigmay[3]*sigmay[3]*sigmay[3])*pow(my[3]-y[3],2.0)*-1.0+1.0/sigmay[3]; - break; - case 4: - dJydsigma[0+4*1] = 1.0/(sigmay[4]*sigmay[4]*sigmay[4])*pow(my[4]-y[4],2.0)*-1.0+1.0/sigmay[4]; - break; - case 5: - dJydsigma[0+5*1] = 1.0/(sigmay[5]*sigmay[5]*sigmay[5])*pow(my[5]-y[5],2.0)*-1.0+1.0/sigmay[5]; - break; -} -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/dJydy.cpp b/models/model_calvetti/dJydy.cpp deleted file mode 100644 index 16187c1807..0000000000 --- a/models/model_calvetti/dJydy.cpp +++ /dev/null @@ -1,39 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void dJydy_model_calvetti(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0+0*1] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; - case 1: - dJydy[0+1*1] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - break; - case 2: - dJydy[0+2*1] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - break; - case 3: - dJydy[0+3*1] = 1.0/(sigmay[3]*sigmay[3])*(my[3]*2.0-y[3]*2.0)*-5.0E-1; - break; - case 4: - dJydy[0+4*1] = 1.0/(sigmay[4]*sigmay[4])*(my[4]*2.0-y[4]*2.0)*-5.0E-1; - break; - case 5: - dJydy[0+5*1] = 1.0/(sigmay[5]*sigmay[5])*(my[5]*2.0-y[5]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/dwdx.cpp b/models/model_calvetti/dwdx.cpp deleted file mode 100644 index f185abd31f..0000000000 --- a/models/model_calvetti/dwdx.cpp +++ /dev/null @@ -1,72 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void dwdx_model_calvetti(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) { - dwdx[0] = 1.0/(x[0]*x[0]*x[0])*-2.0; - dwdx[1] = k[1]*w[15]*dwdx[0]; - dwdx[2] = dwdx[1]; - dwdx[3] = x[3]*dwdx[2]; - dwdx[4] = dwdx[3]; - dwdx[5] = -1.0/(w[20]*w[20])*dwdx[4]; - dwdx[6] = w[0]*w[14]*w[21]*(2.0/3.1E1)+w[0]*x[0]*w[14]*dwdx[5]*(2.0/3.1E1); - dwdx[7] = x[0]*2.0; - dwdx[8] = 1.0/(x[1]*x[1]*x[1])*-2.0; - dwdx[9] = k[3]*w[1]*dwdx[8]; - dwdx[10] = dwdx[9]; - dwdx[11] = x[4]*dwdx[10]; - dwdx[12] = dwdx[9]; - dwdx[13] = x[3]*dwdx[12]; - dwdx[14] = dwdx[11]+dwdx[13]; - dwdx[15] = -1.0/(w[20]*w[20])*dwdx[14]; - dwdx[16] = w[0]*x[0]*w[14]*dwdx[15]*(2.0/3.1E1); - dwdx[17] = dwdx[11]; - dwdx[18] = -1.0/(w[26]*w[26])*dwdx[17]; - dwdx[19] = w[6]*w[27]*w[29]*(2.0/1.63E2)+x[1]*w[6]*w[29]*dwdx[18]*(2.0/1.63E2); - dwdx[20] = 1.0/(x[2]*x[2]*x[2])*-2.0; - dwdx[21] = k[5]*w[4]*dwdx[20]; - dwdx[22] = dwdx[21]; - dwdx[23] = x[4]*dwdx[22]; - dwdx[24] = k[5]*w[4]*x[5]*dwdx[20]; - dwdx[25] = x[2]*2.0; - dwdx[26] = dwdx[23]+dwdx[24]; - dwdx[27] = -1.0/(w[20]*w[20])*dwdx[26]; - dwdx[28] = w[0]*x[0]*w[14]*dwdx[27]*(2.0/3.1E1); - dwdx[29] = dwdx[23]+dwdx[24]; - dwdx[30] = -1.0/(w[26]*w[26])*dwdx[29]; - dwdx[31] = x[1]*w[6]*w[29]*dwdx[30]*(2.0/1.63E2); - dwdx[32] = w[11]*w[32]*w[33]*w[34]*w[36]*(1.0/6.1E1)+x[2]*w[32]*w[33]*w[34]*w[36]*dwdx[25]*(1.0/6.1E1); - dwdx[33] = w[18]; - dwdx[34] = dwdx[33]; - dwdx[35] = -1.0/(w[20]*w[20])*dwdx[34]; - dwdx[36] = w[0]*x[0]*w[14]*dwdx[35]*(2.0/3.1E1); - dwdx[37] = w[8]; - dwdx[38] = dwdx[37]; - dwdx[39] = -1.0/(w[20]*w[20])*dwdx[38]; - dwdx[40] = w[0]*x[0]*w[14]*dwdx[39]*(2.0/3.1E1); - dwdx[41] = dwdx[37]; - dwdx[42] = -1.0/(w[26]*w[26])*dwdx[41]; - dwdx[43] = x[1]*w[6]*w[29]*dwdx[42]*(2.0/1.63E2); - dwdx[44] = k[5]*w[4]*w[5]; - dwdx[45] = dwdx[44]; - dwdx[46] = -1.0/(w[20]*w[20])*dwdx[45]; - dwdx[47] = w[0]*x[0]*w[14]*dwdx[46]*(2.0/3.1E1); - dwdx[48] = dwdx[44]; - dwdx[49] = -1.0/(w[26]*w[26])*dwdx[48]; - dwdx[50] = x[1]*w[6]*w[29]*dwdx[49]*(2.0/1.63E2); - dwdx[51] = -1.0/(x[5]*x[5]); - dwdx[52] = x[2]*w[11]*w[32]*w[33]*w[36]*dwdx[51]*(1.0/6.1E1); -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/dydx.cpp b/models/model_calvetti/dydx.cpp deleted file mode 100644 index d6872b7ad1..0000000000 --- a/models/model_calvetti/dydx.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void dydx_model_calvetti(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+0*6] = 1.0; - dydx[1+1*6] = 1.0; - dydx[2+2*6] = 1.0; - dydx[3+0*6] = (x[3]*2.0)/x[0]+(1.0/(k[0]*k[0])*x[0]*4.0)/k[1]-(1.0/(k[0]*k[0])*x[0]*(x[3]*((k[0]*k[0])*k[1]*1.0/(x[0]*x[0])+(k[2]*k[2])*k[3]*1.0/(x[1]*x[1]))+x[4]*((k[2]*k[2])*k[3]*1.0/(x[1]*x[1])+(k[4]*k[4])*k[5]*1.0/(x[2]*x[2]))+(k[4]*k[4])*k[5]*1.0/(x[2]*x[2])*x[5])*2.0)/k[1]; - dydx[3+1*6] = (1.0/(k[0]*k[0])*(x[0]*x[0])*((k[2]*k[2])*k[3]*1.0/(x[1]*x[1]*x[1])*x[3]*2.0+(k[2]*k[2])*k[3]*1.0/(x[1]*x[1]*x[1])*x[4]*2.0))/k[1]; - dydx[3+2*6] = (1.0/(k[0]*k[0])*(x[0]*x[0])*((k[4]*k[4])*k[5]*1.0/(x[2]*x[2]*x[2])*x[4]*2.0+(k[4]*k[4])*k[5]*1.0/(x[2]*x[2]*x[2])*x[5]*2.0))/k[1]; - dydx[3+3*6] = -(1.0/(k[0]*k[0])*(x[0]*x[0])*((k[0]*k[0])*k[1]*1.0/(x[0]*x[0])+(k[2]*k[2])*k[3]*1.0/(x[1]*x[1])))/k[1]; - dydx[3+4*6] = -(1.0/(k[0]*k[0])*(x[0]*x[0])*((k[2]*k[2])*k[3]*1.0/(x[1]*x[1])+(k[4]*k[4])*k[5]*1.0/(x[2]*x[2])))/k[1]; - dydx[3+5*6] = -(1.0/(k[0]*k[0])*(k[4]*k[4])*k[5]*(x[0]*x[0])*1.0/(x[2]*x[2]))/k[1]; - dydx[4+3*6] = 1.0; - dydx[5+4*6] = 1.0; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/main.cpp b/models/model_calvetti/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_calvetti/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_calvetti/model_calvetti.h b/models/model_calvetti/model_calvetti.h deleted file mode 100644 index bdc00bdac9..0000000000 --- a/models/model_calvetti/model_calvetti.h +++ /dev/null @@ -1,213 +0,0 @@ -#ifndef _amici_model_calvetti_h -#define _amici_model_calvetti_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_idas.h" -#include "amici/model_dae.h" - -namespace amici { - -class Solver; - -namespace model_model_calvetti{ - -extern void JSparse_model_calvetti(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx); -extern void Jy_model_calvetti(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void M_model_calvetti(realtype *M, const realtype t, const realtype *x, const realtype *p, const realtype *k); -extern void dJydsigma_model_calvetti(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_calvetti(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dwdx_model_calvetti(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static); -extern void dydx_model_calvetti(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void root_model_calvetti(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx); -extern void sigmay_model_calvetti(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void w_model_calvetti(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static); -extern void x0_model_calvetti(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_calvetti(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w); -extern void y_model_calvetti(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); - -class Model_model_calvetti : public amici::Model_DAE { -public: - Model_model_calvetti() - : amici::Model_DAE( - amici::ModelDimensions( - 6, - 6, - 6, - 6, - 0, - 0, - 6, - 6, - 6, - 0, - 0, - 4, - 4, - 0, - 1, - 38, - 53, - 0, - 0, - 0, - {}, - 0, - 0, - 0, - 26, - 5, - 3 - ), - amici::SimulationParameters( - std::vector(6, 1.0), - std::vector(0, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{1, 1, 1, 0, 0, 0}, - std::vector{}) - {}; - - amici::Model* clone() const override { return new Model_model_calvetti(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) override { - JSparse_model_calvetti(JSparse, t, x, p, k, h, cj, dx, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_calvetti(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fM(realtype *M, const realtype t, const realtype *x, const realtype *p, const realtype *k) override { - M_model_calvetti(M, t, x, p, k); - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_calvetti(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_calvetti(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - dwdx_model_calvetti(dwdx, t, x, p, k, h, w, tcl, spl, include_static); - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *dx, const realtype *w, const realtype *dwdp) override { - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx) override { - root_model_calvetti(root, t, x, p, k, h, dx); - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_calvetti(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - w_model_calvetti(w, t, x, p, k, h, tcl, spl, include_static); - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_calvetti(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w) override { - xdot_model_calvetti(xdot, t, x, p, k, h, dx, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_calvetti(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - -}; - -} // namespace model_model_calvetti - -} // namespace amici - -#endif /* _amici_model_calvetti_h */ diff --git a/models/model_calvetti/rebuild_model_calvetti.m b/models/model_calvetti/rebuild_model_calvetti.m deleted file mode 100644 index ef44a7afcd..0000000000 --- a/models/model_calvetti/rebuild_model_calvetti.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_calvetti() -modelName = 'model_calvetti'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(6, 6, 0, 6, 0, 0, [], ['simulate_' modelName '.m'], 'model_calvetti', 'lin', 1, 1); -end diff --git a/models/model_calvetti/root.cpp b/models/model_calvetti/root.cpp deleted file mode 100644 index 8fda25149a..0000000000 --- a/models/model_calvetti/root.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void root_model_calvetti(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx) { - root[0] = -t+1.0E1; - root[1] = -t+1.2E1; - root[2] = t-1.0E1; - root[3] = t-1.2E1; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/sigmay.cpp b/models/model_calvetti/sigmay.cpp deleted file mode 100644 index 690d1a01a9..0000000000 --- a/models/model_calvetti/sigmay.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void sigmay_model_calvetti(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; - sigmay[1] = 1.0; - sigmay[2] = 1.0; - sigmay[3] = 1.0; - sigmay[4] = 1.0; - sigmay[5] = 1.0; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/swig/CMakeLists.txt b/models/model_calvetti/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_calvetti/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_calvetti/swig/model_calvetti.i b/models/model_calvetti/swig/model_calvetti.i deleted file mode 100644 index a904745877..0000000000 --- a/models/model_calvetti/swig/model_calvetti.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_calvetti -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_calvetti/w.cpp b/models/model_calvetti/w.cpp deleted file mode 100644 index 38773562d3..0000000000 --- a/models/model_calvetti/w.cpp +++ /dev/null @@ -1,57 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void w_model_calvetti(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) { - w[0] = 1.0/k[0]; - w[1] = k[2]*k[2]; - w[2] = 1.0/(x[1]*x[1]); - w[3] = k[3]*w[1]*w[2]; - w[4] = k[4]*k[4]; - w[5] = 1.0/(x[2]*x[2]); - w[6] = 1.0/k[2]; - w[7] = k[5]*w[4]*w[5]; - w[8] = w[3]+w[7]; - w[9] = x[4]*w[8]; - w[10] = k[5]*w[4]*w[5]*x[5]; - w[11] = x[2]*x[2]; - w[12] = h[1]*(1.0/3.1E1); - w[13] = k[1]*(1.0/2.0); - w[14] = w[13]-1.0; - w[15] = k[0]*k[0]; - w[16] = 1.0/(x[0]*x[0]); - w[17] = k[1]*w[15]*w[16]; - w[18] = w[3]+w[17]; - w[19] = x[3]*w[18]; - w[20] = w[9]+w[10]+w[19]; - w[21] = 1.0/w[20]; - w[22] = w[0]*x[0]*w[14]*w[21]*(2.0/3.1E1); - w[23] = 1.0/(k[0]*k[0]); - w[24] = 1.0/k[1]; - w[25] = x[0]*x[0]; - w[26] = w[9]+w[10]; - w[27] = 1.0/w[26]; - w[28] = k[3]*(1.0/2.0); - w[29] = k[1]+w[28]-1.0; - w[30] = x[1]*w[6]*w[27]*w[29]*(2.0/1.63E2); - w[31] = 1.0/k[4]; - w[32] = 1.0/(k[4]*k[4]*k[4]); - w[33] = 1.0/k[5]; - w[34] = 1.0/x[5]; - w[35] = k[5]*(1.0/2.0); - w[36] = k[1]+k[3]+w[35]-1.0; - w[37] = x[2]*w[11]*w[32]*w[33]*w[34]*w[36]*(1.0/6.1E1); -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/wrapfunctions.cpp b/models/model_calvetti/wrapfunctions.cpp deleted file mode 100644 index 1764657087..0000000000 --- a/models/model_calvetti/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_calvetti::Model_model_calvetti()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_calvetti/wrapfunctions.h b/models/model_calvetti/wrapfunctions.h deleted file mode 100644 index c7bbb2504d..0000000000 --- a/models/model_calvetti/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_calvetti.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_calvetti/x0.cpp b/models/model_calvetti/x0.cpp deleted file mode 100644 index b021d43f2b..0000000000 --- a/models/model_calvetti/x0.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void x0_model_calvetti(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = k[0]; - x0[1] = k[2]; - x0[2] = k[4]; - x0[3] = 1.0; - x0[4] = 1.0; - x0[5] = 1.0; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/xdot.cpp b/models/model_calvetti/xdot.cpp deleted file mode 100644 index 1ac7f42e9c..0000000000 --- a/models/model_calvetti/xdot.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void xdot_model_calvetti(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w) { - xdot[0] = h[0]*(-1.0/3.1E1)+w[12]+w[22]-dx[0]-w[0]*x[0]*(1.0E2/8.99E2)+1.29E2/8.99E2; - xdot[1] = w[30]-dx[1]-x[1]*w[6]*1.202935161794779E-2+1.816432094310117E-2; - xdot[2] = w[37]-dx[2]-x[2]*w[31]*8.196729508204918E-9+8.196729508204918E-3; - xdot[3] = h[0]*(1.0/3.1E1)-x[3]-w[12]-w[22]+w[0]*x[0]*(1.0E2/8.99E2)+w[23]*w[24]*w[25]*2.0-w[20]*w[23]*w[24]*w[25]-1.29E2/8.99E2; - xdot[4] = x[3]-x[4]-w[30]+x[1]*w[6]*1.202935161794779E-2-1.816432094310117E-2; - xdot[5] = x[4]-x[5]-w[37]+x[2]*w[31]*8.196729508204918E-9-8.196729508204918E-3; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_calvetti/y.cpp b/models/model_calvetti/y.cpp deleted file mode 100644 index af549ee252..0000000000 --- a/models/model_calvetti/y.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_calvetti{ - -void y_model_calvetti(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = x[0]; - y[1] = x[1]; - y[2] = x[2]; - y[3] = (1.0/(k[0]*k[0])*(x[0]*x[0])*2.0)/k[1]-(1.0/(k[0]*k[0])*(x[0]*x[0])*(x[3]*((k[0]*k[0])*k[1]*1.0/(x[0]*x[0])+(k[2]*k[2])*k[3]*1.0/(x[1]*x[1]))+x[4]*((k[2]*k[2])*k[3]*1.0/(x[1]*x[1])+(k[4]*k[4])*k[5]*1.0/(x[2]*x[2]))+(k[4]*k[4])*k[5]*1.0/(x[2]*x[2])*x[5]))/k[1]; - y[4] = x[3]; - y[5] = x[4]; -} - -} // namespace model_model_calvetti - -} // namespace amici - diff --git a/models/model_dirac/CMakeLists.txt b/models/model_dirac/CMakeLists.txt deleted file mode 100644 index 8c07511c40..0000000000 --- a/models/model_dirac/CMakeLists.txt +++ /dev/null @@ -1,118 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_dirac) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/deltasx.cpp -${MODEL_DIR}/deltax.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/root.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/stau.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_dirac/JSparse.cpp b/models/model_dirac/JSparse.cpp deleted file mode 100644 index 7671ba143f..0000000000 --- a/models/model_dirac/JSparse.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void JSparse_model_dirac(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 1; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 2; - JSparse->indexptrs[2] = 3; - JSparse->data[0] = -p[0]; - JSparse->data[1] = p[2]; - JSparse->data[2] = -p[3]; -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/Jy.cpp b/models/model_dirac/Jy.cpp deleted file mode 100644 index 228ea6bb2e..0000000000 --- a/models/model_dirac/Jy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void Jy_model_dirac(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/dJydsigma.cpp b/models/model_dirac/dJydsigma.cpp deleted file mode 100644 index 540bcc832e..0000000000 --- a/models/model_dirac/dJydsigma.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void dJydsigma_model_dirac(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0]*1.0,2.0)*-1.0+1.0/sigmay[0]; - break; -} -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/dJydy.cpp b/models/model_dirac/dJydy.cpp deleted file mode 100644 index 86ab371f73..0000000000 --- a/models/model_dirac/dJydy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void dJydy_model_dirac(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/deltasx.cpp b/models/model_dirac/deltasx.cpp deleted file mode 100644 index ebb0be64cb..0000000000 --- a/models/model_dirac/deltasx.cpp +++ /dev/null @@ -1,93 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void deltasx_model_dirac(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/deltax.cpp b/models/model_dirac/deltax.cpp deleted file mode 100644 index 5deddc7e4c..0000000000 --- a/models/model_dirac/deltax.cpp +++ /dev/null @@ -1,31 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void deltax_model_dirac(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) { - switch(ie) { - case 0: { - deltax[0] = 1.0; - - } break; - - case 1: { - deltax[0] = 1.0; - - } break; - - } -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/dxdotdp.cpp b/models/model_dirac/dxdotdp.cpp deleted file mode 100644 index fb3a1380a1..0000000000 --- a/models/model_dirac/dxdotdp.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void dxdotdp_model_dirac(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[0] = -x[0]; - - } break; - - case 2: { - dxdotdp[1] = x[0]; - - } break; - - case 3: { - dxdotdp[1] = -x[1]; - - } break; - -} -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/dydx.cpp b/models/model_dirac/dydx.cpp deleted file mode 100644 index 18a73e367a..0000000000 --- a/models/model_dirac/dydx.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void dydx_model_dirac(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+1*1] = 1.0; -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/main.cpp b/models/model_dirac/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_dirac/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_dirac/model_dirac.h b/models/model_dirac/model_dirac.h deleted file mode 100644 index a8803237ca..0000000000 --- a/models/model_dirac/model_dirac.h +++ /dev/null @@ -1,210 +0,0 @@ -#ifndef _amici_model_dirac_h -#define _amici_model_dirac_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_dirac{ - -extern void JSparse_model_dirac(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jy_model_dirac(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydsigma_model_dirac(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_dirac(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void deltasx_model_dirac(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl); -extern void deltax_model_dirac(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old); -extern void dxdotdp_model_dirac(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_dirac(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void root_model_dirac(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl); -extern void sigmay_model_dirac(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void stau_model_dirac(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie); -extern void xdot_model_dirac(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_dirac(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); - -class Model_model_dirac : public amici::Model_ODE { -public: - Model_model_dirac() - : amici::Model_ODE( - amici::ModelDimensions( - 2, - 2, - 2, - 2, - 0, - 4, - 0, - 1, - 1, - 0, - 0, - 2, - 2, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - {}, - 0, - 0, - 0, - 3, - 0, - 1 - ), - amici::SimulationParameters( - std::vector(0, 1.0), - std::vector(4, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{0, 0}, - std::vector{}) - {}; - - amici::Model* clone() const override { return new Model_model_dirac(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_dirac(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_dirac(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_dirac(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_dirac(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - deltasx_model_dirac(deltasx, t, x, p, k, h, w, ip, ie, xdot, xdot_old, sx, stau, tcl); - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - deltax_model_dirac(deltax, t, x, p, k, h, ie, xdot, xdot_old); - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_dirac(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - root_model_dirac(root, t, x, p, k, h, tcl); - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_dirac(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - stau_model_dirac(stau, t, x, p, k, h, tcl, sx, ip, ie); - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_dirac(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_dirac(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - -}; - -} // namespace model_model_dirac - -} // namespace amici - -#endif /* _amici_model_dirac_h */ diff --git a/models/model_dirac/rebuild_model_dirac.m b/models/model_dirac/rebuild_model_dirac.m deleted file mode 100644 index 66aa6f62d9..0000000000 --- a/models/model_dirac/rebuild_model_dirac.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_dirac() -modelName = 'model_dirac'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(2, 1, 4, 0, 0, 0, [], ['simulate_' modelName '.m'], 'model_dirac', 'log10', 1, 1); -end diff --git a/models/model_dirac/root.cpp b/models/model_dirac/root.cpp deleted file mode 100644 index ce1c5f4364..0000000000 --- a/models/model_dirac/root.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void root_model_dirac(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) { - root[0] = -t+p[1]; - root[1] = t-p[1]; -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/sigmay.cpp b/models/model_dirac/sigmay.cpp deleted file mode 100644 index 9b5782f79f..0000000000 --- a/models/model_dirac/sigmay.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void sigmay_model_dirac(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/stau.cpp b/models/model_dirac/stau.cpp deleted file mode 100644 index 67c725fcea..0000000000 --- a/models/model_dirac/stau.cpp +++ /dev/null @@ -1,37 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void stau_model_dirac(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) { -switch (ip) { - case 1: { - switch(ie) { - case 0: { - stau[0] = 1.0; - - } break; - - case 1: { - stau[0] = 1.0; - - } break; - - } - - } break; - -} -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/swig/CMakeLists.txt b/models/model_dirac/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_dirac/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_dirac/swig/model_dirac.i b/models/model_dirac/swig/model_dirac.i deleted file mode 100644 index 928a883496..0000000000 --- a/models/model_dirac/swig/model_dirac.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_dirac -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_dirac/wrapfunctions.cpp b/models/model_dirac/wrapfunctions.cpp deleted file mode 100644 index b420ef18c9..0000000000 --- a/models/model_dirac/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_dirac::Model_model_dirac()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_dirac/wrapfunctions.h b/models/model_dirac/wrapfunctions.h deleted file mode 100644 index b3bc99a581..0000000000 --- a/models/model_dirac/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_dirac.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_dirac/xdot.cpp b/models/model_dirac/xdot.cpp deleted file mode 100644 index 2a97a2d205..0000000000 --- a/models/model_dirac/xdot.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void xdot_model_dirac(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = -p[0]*x[0]; - xdot[1] = p[2]*x[0]-p[3]*x[1]; -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_dirac/y.cpp b/models/model_dirac/y.cpp deleted file mode 100644 index c24eb7723f..0000000000 --- a/models/model_dirac/y.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_dirac{ - -void y_model_dirac(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = x[1]; -} - -} // namespace model_model_dirac - -} // namespace amici - diff --git a/models/model_events/CMakeLists.txt b/models/model_events/CMakeLists.txt deleted file mode 100644 index 706de289cf..0000000000 --- a/models/model_events/CMakeLists.txt +++ /dev/null @@ -1,132 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_events) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jrz.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/Jz.cpp -${MODEL_DIR}/dJrzdsigma.cpp -${MODEL_DIR}/dJrzdz.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dJzdsigma.cpp -${MODEL_DIR}/dJzdz.cpp -${MODEL_DIR}/deltasx.cpp -${MODEL_DIR}/drzdx.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/dzdx.cpp -${MODEL_DIR}/root.cpp -${MODEL_DIR}/rz.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/sigmaz.cpp -${MODEL_DIR}/srz.cpp -${MODEL_DIR}/stau.cpp -${MODEL_DIR}/sz.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp -${MODEL_DIR}/z.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_events/JSparse.cpp b/models/model_events/JSparse.cpp deleted file mode 100644 index cc527b9d36..0000000000 --- a/models/model_events/JSparse.cpp +++ /dev/null @@ -1,32 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void JSparse_model_events(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 1; - JSparse->indexvals[3] = 2; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 2; - JSparse->indexptrs[2] = 3; - JSparse->indexptrs[3] = 4; - JSparse->data[0] = p[0]*(h[3]-1.0); - JSparse->data[1] = p[1]*exp(t*(-1.0/1.0E1)); - JSparse->data[2] = -p[2]; - JSparse->data[3] = -1.0; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/Jrz.cpp b/models/model_events/Jrz.cpp deleted file mode 100644 index 6f3aa7bf76..0000000000 --- a/models/model_events/Jrz.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void Jrz_model_events(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - nllh[0] = amici::log((sigmaz[0]*sigmaz[0])*3.141592653589793*2.0)*5.0E-1+(rz[0]*rz[0])*1.0/(sigmaz[0]*sigmaz[0])*5.0E-1; - break; - case 1: - nllh[0] = amici::log((sigmaz[1]*sigmaz[1])*3.141592653589793*2.0)*5.0E-1+(rz[1]*rz[1])*1.0/(sigmaz[1]*sigmaz[1])*5.0E-1; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/Jy.cpp b/models/model_events/Jy.cpp deleted file mode 100644 index 237bf2c0e6..0000000000 --- a/models/model_events/Jy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void Jy_model_events(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/Jz.cpp b/models/model_events/Jz.cpp deleted file mode 100644 index 49e741c1be..0000000000 --- a/models/model_events/Jz.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void Jz_model_events(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - nllh[0] = amici::log((sigmaz[0]*sigmaz[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmaz[0]*sigmaz[0])*pow(mz[0]-z[0],2.0)*5.0E-1; - break; - case 1: - nllh[0] = amici::log((sigmaz[1]*sigmaz[1])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmaz[1]*sigmaz[1])*pow(mz[1]-z[1],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dJrzdsigma.cpp b/models/model_events/dJrzdsigma.cpp deleted file mode 100644 index a0bde90ffd..0000000000 --- a/models/model_events/dJrzdsigma.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dJrzdsigma_model_events(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - dJrzdsigma[0+0*1] = (rz[0]*rz[0])*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*-1.0+1.0/sigmaz[0]; - break; - case 1: - dJrzdsigma[0+1*1] = (rz[1]*rz[1])*1.0/(sigmaz[1]*sigmaz[1]*sigmaz[1])*-1.0+1.0/sigmaz[1]; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dJrzdz.cpp b/models/model_events/dJrzdz.cpp deleted file mode 100644 index c82ffa207f..0000000000 --- a/models/model_events/dJrzdz.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dJrzdz_model_events(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - dJrzdz[0+0*1] = rz[0]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - break; - case 1: - dJrzdz[0+1*1] = rz[1]*1.0/(sigmaz[1]*sigmaz[1])*1.0; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dJydsigma.cpp b/models/model_events/dJydsigma.cpp deleted file mode 100644 index 9ad536a14a..0000000000 --- a/models/model_events/dJydsigma.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dJydsigma_model_events(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0]*1.0,2.0)*-1.0+1.0/sigmay[0]; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dJydy.cpp b/models/model_events/dJydy.cpp deleted file mode 100644 index 7fed2977b7..0000000000 --- a/models/model_events/dJydy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dJydy_model_events(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dJzdsigma.cpp b/models/model_events/dJzdsigma.cpp deleted file mode 100644 index a45d1fbf03..0000000000 --- a/models/model_events/dJzdsigma.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dJzdsigma_model_events(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - dJzdsigma[0+0*1] = 1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*pow(mz[0]-z[0],2.0)*-1.0+1.0/sigmaz[0]; - break; - case 1: - dJzdsigma[0+1*1] = 1.0/(sigmaz[1]*sigmaz[1]*sigmaz[1])*pow(mz[1]-z[1],2.0)*-1.0+1.0/sigmaz[1]; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dJzdz.cpp b/models/model_events/dJzdz.cpp deleted file mode 100644 index 9fb3b9a0e0..0000000000 --- a/models/model_events/dJzdz.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dJzdz_model_events(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - dJzdz[0+0*1] = 1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - break; - case 1: - dJzdz[0+1*1] = 1.0/(sigmaz[1]*sigmaz[1])*(mz[1]*2.0-z[1]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/deltasx.cpp b/models/model_events/deltasx.cpp deleted file mode 100644 index 9dacb2ee54..0000000000 --- a/models/model_events/deltasx.cpp +++ /dev/null @@ -1,125 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void deltasx_model_events(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) { -switch (ip) { - case 0: { - switch(ie) { - case 2: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 4: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 5: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 2: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 4: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 5: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 2: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 4: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 5: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 2: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 4: { - deltasx[2] = -stau[0]*(xdot[2]-xdot_old[2]); - - } break; - - case 5: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/drzdx.cpp b/models/model_events/drzdx.cpp deleted file mode 100644 index 850fb1e519..0000000000 --- a/models/model_events/drzdx.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void drzdx_model_events(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - drzdx[0+1*2] = 1.0; - drzdx[0+2*2] = -1.0; - drzdx[1+0*2] = 1.0; - drzdx[1+2*2] = -1.0; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dxdotdp.cpp b/models/model_events/dxdotdp.cpp deleted file mode 100644 index 90e07ff62c..0000000000 --- a/models/model_events/dxdotdp.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dxdotdp_model_events(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[0] = x[0]*(h[3]-1.0); - - } break; - - case 1: { - dxdotdp[1] = x[0]*exp(t*(-1.0/1.0E1)); - - } break; - - case 2: { - dxdotdp[1] = -x[1]; - - } break; - -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dydp.cpp b/models/model_events/dydp.cpp deleted file mode 100644 index 45090f6a8a..0000000000 --- a/models/model_events/dydp.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dydp_model_events(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 3: { - dydp[0] = x[0]+x[1]+x[2]; - - } break; - -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dydx.cpp b/models/model_events/dydx.cpp deleted file mode 100644 index 82f7a32171..0000000000 --- a/models/model_events/dydx.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dydx_model_events(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+0*1] = p[3]; - dydx[0+1*1] = p[3]; - dydx[0+2*1] = p[3]; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/dzdx.cpp b/models/model_events/dzdx.cpp deleted file mode 100644 index 7b77136900..0000000000 --- a/models/model_events/dzdx.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void dzdx_model_events(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - dzdx[0+1*2] = -1.0/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - dzdx[0+2*2] = 1.0/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - dzdx[1+0*2] = -1.0/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - dzdx[1+2*2] = 1.0/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/main.cpp b/models/model_events/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_events/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_events/model_events.h b/models/model_events/model_events.h deleted file mode 100644 index bf68b4529a..0000000000 --- a/models/model_events/model_events.h +++ /dev/null @@ -1,238 +0,0 @@ -#ifndef _amici_model_events_h -#define _amici_model_events_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_events{ - -extern void JSparse_model_events(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jrz_model_events(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void Jy_model_events(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void Jz_model_events(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void dJrzdsigma_model_events(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void dJrzdz_model_events(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void dJydsigma_model_events(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_events(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJzdsigma_model_events(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void dJzdz_model_events(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void deltasx_model_events(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl); -extern void drzdx_model_events(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void dxdotdp_model_events(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydp_model_events(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_events(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void dzdx_model_events(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void root_model_events(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl); -extern void rz_model_events(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void sigmay_model_events(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void sigmaz_model_events(double *sigmaz, const realtype t, const realtype *p, const realtype *k); -extern void srz_model_events(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip); -extern void stau_model_events(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie); -extern void sz_model_events(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip); -extern void x0_model_events(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_events(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_events(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void z_model_events(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); - -class Model_model_events : public amici::Model_ODE { -public: - Model_model_events() - : amici::Model_ODE( - amici::ModelDimensions( - 3, - 3, - 3, - 3, - 0, - 4, - 4, - 1, - 1, - 2, - 2, - 6, - 6, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - {}, - 0, - 0, - 0, - 4, - 0, - 1 - ), - amici::SimulationParameters( - std::vector(4, 1.0), - std::vector(4, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{0, 0, 0}, - std::vector{1, 2}) - {}; - - amici::Model* clone() const override { return new Model_model_events(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_events(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - Jrz_model_events(nllh, iz, p, k, rz, sigmaz); - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_events(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - Jz_model_events(nllh, iz, p, k, z, sigmaz, mz); - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - dJrzdsigma_model_events(dJrzdsigma, iz, p, k, rz, sigmaz); - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - dJrzdz_model_events(dJrzdz, iz, p, k, rz, sigmaz); - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_events(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_events(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - dJzdsigma_model_events(dJzdsigma, iz, p, k, z, sigmaz, mz); - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - dJzdz_model_events(dJzdz, iz, p, k, z, sigmaz, mz); - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - deltasx_model_events(deltasx, t, x, p, k, h, w, ip, ie, xdot, xdot_old, sx, stau, tcl); - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - drzdx_model_events(drzdx, ie, t, x, p, k, h); - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_events(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dydp_model_events(dydp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - dzdx_model_events(dzdx, ie, t, x, p, k, h); - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - root_model_events(root, t, x, p, k, h, tcl); - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - rz_model_events(rz, ie, t, x, p, k, h); - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_events(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - sigmaz_model_events(sigmaz, t, p, k); - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - srz_model_events(srz, ie, t, x, p, k, h, sx, ip); - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - stau_model_events(stau, t, x, p, k, h, tcl, sx, ip, ie); - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - sz_model_events(sz, ie, t, x, p, k, h, sx, ip); - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_events(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_events(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_events(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - z_model_events(z, ie, t, x, p, k, h); - } - -}; - -} // namespace model_model_events - -} // namespace amici - -#endif /* _amici_model_events_h */ diff --git a/models/model_events/rebuild_model_events.m b/models/model_events/rebuild_model_events.m deleted file mode 100644 index bbb591694d..0000000000 --- a/models/model_events/rebuild_model_events.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_events() -modelName = 'model_events'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(3, 1, 4, 4, 2, 0, [], ['simulate_' modelName '.m'], 'model_events', 'log10', 1, 1); -end diff --git a/models/model_events/root.cpp b/models/model_events/root.cpp deleted file mode 100644 index 9207a8a25f..0000000000 --- a/models/model_events/root.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void root_model_events(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) { - root[0] = x[1]-x[2]; - root[1] = x[0]-x[2]; - root[2] = -t+4.0; - root[3] = -t+p[3]; - root[4] = t-4.0; - root[5] = t-p[3]; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/rz.cpp b/models/model_events/rz.cpp deleted file mode 100644 index 357f7c5a34..0000000000 --- a/models/model_events/rz.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void rz_model_events(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - switch(ie) { - case 0: { - rz[0] = x[1]-x[2]; - - } break; - - case 1: { - rz[1] = x[0]-x[2]; - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/sigmay.cpp b/models/model_events/sigmay.cpp deleted file mode 100644 index 87bd4ffb30..0000000000 --- a/models/model_events/sigmay.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void sigmay_model_events(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/sigmaz.cpp b/models/model_events/sigmaz.cpp deleted file mode 100644 index 340598b2f6..0000000000 --- a/models/model_events/sigmaz.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void sigmaz_model_events(double *sigmaz, const realtype t, const realtype *p, const realtype *k) { - sigmaz[0] = 1.0; - sigmaz[1] = 1.0; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/srz.cpp b/models/model_events/srz.cpp deleted file mode 100644 index 392d1ba15c..0000000000 --- a/models/model_events/srz.cpp +++ /dev/null @@ -1,149 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void srz_model_events(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - srz[0] = sx[1]-sx[2]; - - } break; - - case 1: { - srz[1] = sx[0]-sx[2]; - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - srz[0] = sx[1]-sx[2]; - - } break; - - case 1: { - srz[1] = sx[0]-sx[2]; - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - srz[0] = sx[1]-sx[2]; - - } break; - - case 1: { - srz[1] = sx[0]-sx[2]; - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - srz[0] = sx[1]-sx[2]; - - } break; - - case 1: { - srz[1] = sx[0]-sx[2]; - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/stau.cpp b/models/model_events/stau.cpp deleted file mode 100644 index 6a192189e1..0000000000 --- a/models/model_events/stau.cpp +++ /dev/null @@ -1,151 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void stau_model_events(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - stau[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - stau[0] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - stau[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - stau[0] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - stau[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - stau[0] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - stau[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - stau[0] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - stau[0] = 1.0; - - } break; - - case 4: { - - } break; - - case 5: { - stau[0] = 1.0; - - } break; - - } - - } break; - -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/swig/CMakeLists.txt b/models/model_events/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_events/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_events/swig/model_events.i b/models/model_events/swig/model_events.i deleted file mode 100644 index e4a556aa15..0000000000 --- a/models/model_events/swig/model_events.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_events -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_events/sz.cpp b/models/model_events/sz.cpp deleted file mode 100644 index 4e6af3fb7d..0000000000 --- a/models/model_events/sz.cpp +++ /dev/null @@ -1,149 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void sz_model_events(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - sz[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - sz[1] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - sz[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - sz[1] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - sz[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - sz[1] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - sz[0] = -(sx[1]-sx[2])/(h[2]+x[2]-p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1))-1.0); - - } break; - - case 1: { - sz[1] = -(sx[0]-sx[2])/(h[2]+x[2]+p[0]*x[0]*(h[3]-1.0)-1.0); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } - - } break; - -} -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/wrapfunctions.cpp b/models/model_events/wrapfunctions.cpp deleted file mode 100644 index 91742b50cf..0000000000 --- a/models/model_events/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_events::Model_model_events()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_events/wrapfunctions.h b/models/model_events/wrapfunctions.h deleted file mode 100644 index 4644891ea2..0000000000 --- a/models/model_events/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_events.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_events/x0.cpp b/models/model_events/x0.cpp deleted file mode 100644 index 4718596030..0000000000 --- a/models/model_events/x0.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void x0_model_events(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = k[0]; - x0[1] = k[1]; - x0[2] = k[2]; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/xdot.cpp b/models/model_events/xdot.cpp deleted file mode 100644 index e1ad2d95d3..0000000000 --- a/models/model_events/xdot.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void xdot_model_events(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = p[0]*x[0]*(h[3]-1.0); - xdot[1] = -p[2]*x[1]+p[1]*x[0]*exp(t*(-1.0/1.0E1)); - xdot[2] = -h[2]-x[2]+1.0; -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/y.cpp b/models/model_events/y.cpp deleted file mode 100644 index d5698f0467..0000000000 --- a/models/model_events/y.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void y_model_events(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = p[3]*(x[0]+x[1]+x[2]); -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_events/z.cpp b/models/model_events/z.cpp deleted file mode 100644 index a4579c035e..0000000000 --- a/models/model_events/z.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_events{ - -void z_model_events(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - switch(ie) { - case 0: { - z[0] = t; - - } break; - - case 1: { - z[1] = t; - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - case 4: { - - } break; - - case 5: { - - } break; - - } -} - -} // namespace model_model_events - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/CMakeLists.txt b/models/model_jakstat_adjoint/CMakeLists.txt deleted file mode 100644 index 4407583796..0000000000 --- a/models/model_jakstat_adjoint/CMakeLists.txt +++ /dev/null @@ -1,121 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_jakstat_adjoint) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dsigmaydp.cpp -${MODEL_DIR}/dwdp.cpp -${MODEL_DIR}/dwdx.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/sx0.cpp -${MODEL_DIR}/w.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_jakstat_adjoint/JSparse.cpp b/models/model_jakstat_adjoint/JSparse.cpp deleted file mode 100644 index e30cd2d042..0000000000 --- a/models/model_jakstat_adjoint/JSparse.cpp +++ /dev/null @@ -1,66 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void JSparse_model_jakstat_adjoint(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 1; - JSparse->indexvals[3] = 2; - JSparse->indexvals[4] = 2; - JSparse->indexvals[5] = 3; - JSparse->indexvals[6] = 3; - JSparse->indexvals[7] = 4; - JSparse->indexvals[8] = 4; - JSparse->indexvals[9] = 5; - JSparse->indexvals[10] = 5; - JSparse->indexvals[11] = 6; - JSparse->indexvals[12] = 6; - JSparse->indexvals[13] = 7; - JSparse->indexvals[14] = 7; - JSparse->indexvals[15] = 8; - JSparse->indexvals[16] = 0; - JSparse->indexvals[17] = 8; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 2; - JSparse->indexptrs[2] = 4; - JSparse->indexptrs[3] = 6; - JSparse->indexptrs[4] = 8; - JSparse->indexptrs[5] = 10; - JSparse->indexptrs[6] = 12; - JSparse->indexptrs[7] = 14; - JSparse->indexptrs[8] = 16; - JSparse->indexptrs[9] = 18; - JSparse->data[0] = -p[0]*w[0]; - JSparse->data[1] = p[0]*w[0]; - JSparse->data[2] = p[1]*dwdx[0]*-2.0; - JSparse->data[3] = p[1]*dwdx[0]; - JSparse->data[4] = -p[2]; - JSparse->data[5] = (k[0]*p[2])/k[1]; - JSparse->data[6] = -p[3]; - JSparse->data[7] = p[3]*2.0; - JSparse->data[8] = -p[3]; - JSparse->data[9] = p[3]; - JSparse->data[10] = -p[3]; - JSparse->data[11] = p[3]; - JSparse->data[12] = -p[3]; - JSparse->data[13] = p[3]; - JSparse->data[14] = -p[3]; - JSparse->data[15] = p[3]; - JSparse->data[16] = (k[1]*p[3])/k[0]; - JSparse->data[17] = -p[3]; -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/Jy.cpp b/models/model_jakstat_adjoint/Jy.cpp deleted file mode 100644 index 2db2d128ec..0000000000 --- a/models/model_jakstat_adjoint/Jy.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void Jy_model_jakstat_adjoint(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; - case 1: - nllh[0] = amici::log((sigmay[1]*sigmay[1])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*5.0E-1; - break; - case 2: - nllh[0] = amici::log((sigmay[2]*sigmay[2])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dJydsigma.cpp b/models/model_jakstat_adjoint/dJydsigma.cpp deleted file mode 100644 index 1a11141f4d..0000000000 --- a/models/model_jakstat_adjoint/dJydsigma.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dJydsigma_model_jakstat_adjoint(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0+0*1] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*-1.0+1.0/sigmay[0]; - break; - case 1: - dJydsigma[0+1*1] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*-1.0+1.0/sigmay[1]; - break; - case 2: - dJydsigma[0+2*1] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*-1.0+1.0/sigmay[2]; - break; -} -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dJydy.cpp b/models/model_jakstat_adjoint/dJydy.cpp deleted file mode 100644 index 32e0314afa..0000000000 --- a/models/model_jakstat_adjoint/dJydy.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dJydy_model_jakstat_adjoint(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0+0*1] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; - case 1: - dJydy[0+1*1] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - break; - case 2: - dJydy[0+2*1] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dsigmaydp.cpp b/models/model_jakstat_adjoint/dsigmaydp.cpp deleted file mode 100644 index 7313fb731b..0000000000 --- a/models/model_jakstat_adjoint/dsigmaydp.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dsigmaydp_model_jakstat_adjoint(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) { -switch (ip) { - case 14: { - dsigmaydp[0] = 1.0; - - } break; - - case 15: { - dsigmaydp[1] = 1.0; - - } break; - - case 16: { - dsigmaydp[2] = 1.0; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dwdp.cpp b/models/model_jakstat_adjoint/dwdp.cpp deleted file mode 100644 index 092466e87b..0000000000 --- a/models/model_jakstat_adjoint/dwdp.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dwdp_model_jakstat_adjoint(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) { - dwdp[0] = amici::Dspline_pos(4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[1] = amici::Dspline_pos(6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[2] = amici::Dspline_pos(8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[3] = amici::Dspline_pos(10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[4] = amici::Dspline_pos(12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dwdx.cpp b/models/model_jakstat_adjoint/dwdx.cpp deleted file mode 100644 index 354b72f246..0000000000 --- a/models/model_jakstat_adjoint/dwdx.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dwdx_model_jakstat_adjoint(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) { - dwdx[0] = x[1]*2.0; -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dxdotdp.cpp b/models/model_jakstat_adjoint/dxdotdp.cpp deleted file mode 100644 index 18473afb39..0000000000 --- a/models/model_jakstat_adjoint/dxdotdp.cpp +++ /dev/null @@ -1,80 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dxdotdp_model_jakstat_adjoint(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[0] = -w[0]*x[0]; - dxdotdp[1] = w[0]*x[0]; - - } break; - - case 1: { - dxdotdp[1] = w[1]*-2.0; - dxdotdp[2] = w[1]; - - } break; - - case 2: { - dxdotdp[2] = -x[2]; - dxdotdp[3] = (k[0]*x[2])/k[1]; - - } break; - - case 3: { - dxdotdp[0] = (k[1]*x[8])/k[0]; - dxdotdp[3] = -x[3]; - dxdotdp[4] = x[3]*2.0-x[4]; - dxdotdp[5] = x[4]-x[5]; - dxdotdp[6] = x[5]-x[6]; - dxdotdp[7] = x[6]-x[7]; - dxdotdp[8] = x[7]-x[8]; - - } break; - - case 5: { - dxdotdp[0] = -p[0]*x[0]*dwdp[0]; - dxdotdp[1] = p[0]*x[0]*dwdp[0]; - - } break; - - case 6: { - dxdotdp[0] = -p[0]*x[0]*dwdp[1]; - dxdotdp[1] = p[0]*x[0]*dwdp[1]; - - } break; - - case 7: { - dxdotdp[0] = -p[0]*x[0]*dwdp[2]; - dxdotdp[1] = p[0]*x[0]*dwdp[2]; - - } break; - - case 8: { - dxdotdp[0] = -p[0]*x[0]*dwdp[3]; - dxdotdp[1] = p[0]*x[0]*dwdp[3]; - - } break; - - case 9: { - dxdotdp[0] = -p[0]*x[0]*dwdp[4]; - dxdotdp[1] = p[0]*x[0]*dwdp[4]; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dydp.cpp b/models/model_jakstat_adjoint/dydp.cpp deleted file mode 100644 index c37f018f84..0000000000 --- a/models/model_jakstat_adjoint/dydp.cpp +++ /dev/null @@ -1,72 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dydp_model_jakstat_adjoint(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 4: { - dydp[0] = -1.0/(p[4]*p[4])*p[13]*(x[1]+x[2]*2.0); - dydp[1] = -1.0/(p[4]*p[4])*p[12]*(x[0]+x[1]+x[2]*2.0); - - } break; - - case 5: { - dydp[2] = amici::Dspline_pos(4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 6: { - dydp[2] = amici::Dspline_pos(6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 7: { - dydp[2] = amici::Dspline_pos(8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 8: { - dydp[2] = amici::Dspline_pos(10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 9: { - dydp[2] = amici::Dspline_pos(12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 10: { - dydp[1] = 1.0; - - } break; - - case 11: { - dydp[0] = 1.0; - - } break; - - case 12: { - dydp[1] = (x[0]+x[1]+x[2]*2.0)/p[4]; - - } break; - - case 13: { - dydp[0] = (x[1]+x[2]*2.0)/p[4]; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/dydx.cpp b/models/model_jakstat_adjoint/dydx.cpp deleted file mode 100644 index 3a16b74c17..0000000000 --- a/models/model_jakstat_adjoint/dydx.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void dydx_model_jakstat_adjoint(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+1*3] = p[13]/p[4]; - dydx[0+2*3] = (p[13]*2.0)/p[4]; - dydx[1+0*3] = p[12]/p[4]; - dydx[1+1*3] = p[12]/p[4]; - dydx[1+2*3] = (p[12]*2.0)/p[4]; -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/main.cpp b/models/model_jakstat_adjoint/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_jakstat_adjoint/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_jakstat_adjoint/model_jakstat_adjoint.h b/models/model_jakstat_adjoint/model_jakstat_adjoint.h deleted file mode 100644 index 7d3b9290f4..0000000000 --- a/models/model_jakstat_adjoint/model_jakstat_adjoint.h +++ /dev/null @@ -1,216 +0,0 @@ -#ifndef _amici_model_jakstat_adjoint_h -#define _amici_model_jakstat_adjoint_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_jakstat_adjoint{ - -extern void JSparse_model_jakstat_adjoint(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jy_model_jakstat_adjoint(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydsigma_model_jakstat_adjoint(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_jakstat_adjoint(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dsigmaydp_model_jakstat_adjoint(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip); -extern void dwdp_model_jakstat_adjoint(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static); -extern void dwdx_model_jakstat_adjoint(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static); -extern void dxdotdp_model_jakstat_adjoint(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydp_model_jakstat_adjoint(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_jakstat_adjoint(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void sigmay_model_jakstat_adjoint(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void sx0_model_jakstat_adjoint(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip); -extern void w_model_jakstat_adjoint(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static); -extern void x0_model_jakstat_adjoint(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_jakstat_adjoint(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_jakstat_adjoint(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); - -class Model_model_jakstat_adjoint : public amici::Model_ODE { -public: - Model_model_jakstat_adjoint() - : amici::Model_ODE( - amici::ModelDimensions( - 9, - 9, - 9, - 9, - 0, - 17, - 2, - 3, - 3, - 0, - 0, - 0, - 0, - 0, - 1, - 2, - 1, - 5, - 0, - 0, - {}, - 0, - 0, - 0, - 18, - 8, - 1 - ), - amici::SimulationParameters( - std::vector(2, 1.0), - std::vector(17, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{0, 0, 0, 0, 0, 0, 0, 0, 0}, - std::vector{}) - {}; - - amici::Model* clone() const override { return new Model_model_jakstat_adjoint(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_jakstat_adjoint(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_jakstat_adjoint(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_jakstat_adjoint(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_jakstat_adjoint(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - dsigmaydp_model_jakstat_adjoint(dsigmaydp, t, p, k, y, ip); - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - dwdp_model_jakstat_adjoint(dwdp, t, x, p, k, h, w, tcl, stcl, spl, sspl, include_static); - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - dwdx_model_jakstat_adjoint(dwdx, t, x, p, k, h, w, tcl, spl, include_static); - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_jakstat_adjoint(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dydp_model_jakstat_adjoint(dydp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_jakstat_adjoint(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - sx0_model_jakstat_adjoint(sx0, t, x0, p, k, ip); - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - w_model_jakstat_adjoint(w, t, x, p, k, h, tcl, spl, include_static); - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_jakstat_adjoint(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_jakstat_adjoint(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_jakstat_adjoint(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - -}; - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - -#endif /* _amici_model_jakstat_adjoint_h */ diff --git a/models/model_jakstat_adjoint/rebuild_model_jakstat_adjoint.m b/models/model_jakstat_adjoint/rebuild_model_jakstat_adjoint.m deleted file mode 100644 index 443952d4c4..0000000000 --- a/models/model_jakstat_adjoint/rebuild_model_jakstat_adjoint.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_jakstat_adjoint() -modelName = 'model_jakstat_adjoint'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(9, 3, 17, 2, 0, 0, [], ['simulate_' modelName '.m'], 'model_jakstat_adjoint', 'log10', 1, 1); -end diff --git a/models/model_jakstat_adjoint/sigmay.cpp b/models/model_jakstat_adjoint/sigmay.cpp deleted file mode 100644 index 99dd28dff6..0000000000 --- a/models/model_jakstat_adjoint/sigmay.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void sigmay_model_jakstat_adjoint(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = p[14]; - sigmay[1] = p[15]; - sigmay[2] = p[16]; -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/swig/CMakeLists.txt b/models/model_jakstat_adjoint/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_jakstat_adjoint/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_jakstat_adjoint/swig/model_jakstat_adjoint.i b/models/model_jakstat_adjoint/swig/model_jakstat_adjoint.i deleted file mode 100644 index a986a6a5d2..0000000000 --- a/models/model_jakstat_adjoint/swig/model_jakstat_adjoint.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_jakstat_adjoint -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_jakstat_adjoint/sx0.cpp b/models/model_jakstat_adjoint/sx0.cpp deleted file mode 100644 index 7dc5332500..0000000000 --- a/models/model_jakstat_adjoint/sx0.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void sx0_model_jakstat_adjoint(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) { -switch (ip) { - case 4: { - sx0[0] = 1.0; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/w.cpp b/models/model_jakstat_adjoint/w.cpp deleted file mode 100644 index 430b96de3a..0000000000 --- a/models/model_jakstat_adjoint/w.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void w_model_jakstat_adjoint(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) { - w[0] = amici::spline_pos(t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - w[1] = x[1]*x[1]; -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/wrapfunctions.cpp b/models/model_jakstat_adjoint/wrapfunctions.cpp deleted file mode 100644 index 1b40155f0a..0000000000 --- a/models/model_jakstat_adjoint/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_jakstat_adjoint::Model_model_jakstat_adjoint()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/wrapfunctions.h b/models/model_jakstat_adjoint/wrapfunctions.h deleted file mode 100644 index cf6f1a7e2c..0000000000 --- a/models/model_jakstat_adjoint/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_jakstat_adjoint.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_jakstat_adjoint/x0.cpp b/models/model_jakstat_adjoint/x0.cpp deleted file mode 100644 index 2498586d7c..0000000000 --- a/models/model_jakstat_adjoint/x0.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void x0_model_jakstat_adjoint(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = p[4]; -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/xdot.cpp b/models/model_jakstat_adjoint/xdot.cpp deleted file mode 100644 index a31ae44a9f..0000000000 --- a/models/model_jakstat_adjoint/xdot.cpp +++ /dev/null @@ -1,28 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void xdot_model_jakstat_adjoint(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = (k[1]*p[3]*x[8]-k[0]*p[0]*w[0]*x[0])/k[0]; - xdot[1] = p[1]*w[1]*-2.0+p[0]*w[0]*x[0]; - xdot[2] = p[1]*w[1]-p[2]*x[2]; - xdot[3] = (k[0]*p[2]*x[2]-k[1]*p[3]*x[3])/k[1]; - xdot[4] = p[3]*(x[3]*2.0-x[4]); - xdot[5] = p[3]*(x[4]-x[5]); - xdot[6] = p[3]*(x[5]-x[6]); - xdot[7] = p[3]*(x[6]-x[7]); - xdot[8] = p[3]*(x[7]-x[8]); -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint/y.cpp b/models/model_jakstat_adjoint/y.cpp deleted file mode 100644 index 87b30353b1..0000000000 --- a/models/model_jakstat_adjoint/y.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint{ - -void y_model_jakstat_adjoint(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = p[11]+(p[13]*(x[1]+x[2]*2.0))/p[4]; - y[1] = p[10]+(p[12]*(x[0]+x[1]+x[2]*2.0))/p[4]; - y[2] = amici::spline_pos(t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); -} - -} // namespace model_model_jakstat_adjoint - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/CMakeLists.txt b/models/model_jakstat_adjoint_o2/CMakeLists.txt deleted file mode 100644 index a8406acf6b..0000000000 --- a/models/model_jakstat_adjoint_o2/CMakeLists.txt +++ /dev/null @@ -1,121 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_jakstat_adjoint_o2) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dsigmaydp.cpp -${MODEL_DIR}/dwdp.cpp -${MODEL_DIR}/dwdx.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/sx0.cpp -${MODEL_DIR}/w.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_jakstat_adjoint_o2/JSparse.cpp b/models/model_jakstat_adjoint_o2/JSparse.cpp deleted file mode 100644 index eed36174c0..0000000000 --- a/models/model_jakstat_adjoint_o2/JSparse.cpp +++ /dev/null @@ -1,951 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void JSparse_model_jakstat_adjoint_o2(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 9; - JSparse->indexvals[3] = 10; - JSparse->indexvals[4] = 54; - JSparse->indexvals[5] = 55; - JSparse->indexvals[6] = 63; - JSparse->indexvals[7] = 64; - JSparse->indexvals[8] = 72; - JSparse->indexvals[9] = 73; - JSparse->indexvals[10] = 81; - JSparse->indexvals[11] = 82; - JSparse->indexvals[12] = 90; - JSparse->indexvals[13] = 91; - JSparse->indexvals[14] = 1; - JSparse->indexvals[15] = 2; - JSparse->indexvals[16] = 10; - JSparse->indexvals[17] = 11; - JSparse->indexvals[18] = 19; - JSparse->indexvals[19] = 20; - JSparse->indexvals[20] = 28; - JSparse->indexvals[21] = 29; - JSparse->indexvals[22] = 37; - JSparse->indexvals[23] = 38; - JSparse->indexvals[24] = 46; - JSparse->indexvals[25] = 47; - JSparse->indexvals[26] = 55; - JSparse->indexvals[27] = 56; - JSparse->indexvals[28] = 64; - JSparse->indexvals[29] = 65; - JSparse->indexvals[30] = 73; - JSparse->indexvals[31] = 74; - JSparse->indexvals[32] = 82; - JSparse->indexvals[33] = 83; - JSparse->indexvals[34] = 91; - JSparse->indexvals[35] = 92; - JSparse->indexvals[36] = 100; - JSparse->indexvals[37] = 101; - JSparse->indexvals[38] = 109; - JSparse->indexvals[39] = 110; - JSparse->indexvals[40] = 118; - JSparse->indexvals[41] = 119; - JSparse->indexvals[42] = 127; - JSparse->indexvals[43] = 128; - JSparse->indexvals[44] = 136; - JSparse->indexvals[45] = 137; - JSparse->indexvals[46] = 145; - JSparse->indexvals[47] = 146; - JSparse->indexvals[48] = 154; - JSparse->indexvals[49] = 155; - JSparse->indexvals[50] = 2; - JSparse->indexvals[51] = 3; - JSparse->indexvals[52] = 29; - JSparse->indexvals[53] = 30; - JSparse->indexvals[54] = 3; - JSparse->indexvals[55] = 4; - JSparse->indexvals[56] = 39; - JSparse->indexvals[57] = 40; - JSparse->indexvals[58] = 4; - JSparse->indexvals[59] = 5; - JSparse->indexvals[60] = 40; - JSparse->indexvals[61] = 41; - JSparse->indexvals[62] = 5; - JSparse->indexvals[63] = 6; - JSparse->indexvals[64] = 41; - JSparse->indexvals[65] = 42; - JSparse->indexvals[66] = 6; - JSparse->indexvals[67] = 7; - JSparse->indexvals[68] = 42; - JSparse->indexvals[69] = 43; - JSparse->indexvals[70] = 7; - JSparse->indexvals[71] = 8; - JSparse->indexvals[72] = 43; - JSparse->indexvals[73] = 44; - JSparse->indexvals[74] = 0; - JSparse->indexvals[75] = 8; - JSparse->indexvals[76] = 36; - JSparse->indexvals[77] = 44; - JSparse->indexvals[78] = 9; - JSparse->indexvals[79] = 10; - JSparse->indexvals[80] = 10; - JSparse->indexvals[81] = 11; - JSparse->indexvals[82] = 11; - JSparse->indexvals[83] = 12; - JSparse->indexvals[84] = 12; - JSparse->indexvals[85] = 13; - JSparse->indexvals[86] = 13; - JSparse->indexvals[87] = 14; - JSparse->indexvals[88] = 14; - JSparse->indexvals[89] = 15; - JSparse->indexvals[90] = 15; - JSparse->indexvals[91] = 16; - JSparse->indexvals[92] = 16; - JSparse->indexvals[93] = 17; - JSparse->indexvals[94] = 9; - JSparse->indexvals[95] = 17; - JSparse->indexvals[96] = 18; - JSparse->indexvals[97] = 19; - JSparse->indexvals[98] = 19; - JSparse->indexvals[99] = 20; - JSparse->indexvals[100] = 20; - JSparse->indexvals[101] = 21; - JSparse->indexvals[102] = 21; - JSparse->indexvals[103] = 22; - JSparse->indexvals[104] = 22; - JSparse->indexvals[105] = 23; - JSparse->indexvals[106] = 23; - JSparse->indexvals[107] = 24; - JSparse->indexvals[108] = 24; - JSparse->indexvals[109] = 25; - JSparse->indexvals[110] = 25; - JSparse->indexvals[111] = 26; - JSparse->indexvals[112] = 18; - JSparse->indexvals[113] = 26; - JSparse->indexvals[114] = 27; - JSparse->indexvals[115] = 28; - JSparse->indexvals[116] = 28; - JSparse->indexvals[117] = 29; - JSparse->indexvals[118] = 29; - JSparse->indexvals[119] = 30; - JSparse->indexvals[120] = 30; - JSparse->indexvals[121] = 31; - JSparse->indexvals[122] = 31; - JSparse->indexvals[123] = 32; - JSparse->indexvals[124] = 32; - JSparse->indexvals[125] = 33; - JSparse->indexvals[126] = 33; - JSparse->indexvals[127] = 34; - JSparse->indexvals[128] = 34; - JSparse->indexvals[129] = 35; - JSparse->indexvals[130] = 27; - JSparse->indexvals[131] = 35; - JSparse->indexvals[132] = 36; - JSparse->indexvals[133] = 37; - JSparse->indexvals[134] = 37; - JSparse->indexvals[135] = 38; - JSparse->indexvals[136] = 38; - JSparse->indexvals[137] = 39; - JSparse->indexvals[138] = 39; - JSparse->indexvals[139] = 40; - JSparse->indexvals[140] = 40; - JSparse->indexvals[141] = 41; - JSparse->indexvals[142] = 41; - JSparse->indexvals[143] = 42; - JSparse->indexvals[144] = 42; - JSparse->indexvals[145] = 43; - JSparse->indexvals[146] = 43; - JSparse->indexvals[147] = 44; - JSparse->indexvals[148] = 36; - JSparse->indexvals[149] = 44; - JSparse->indexvals[150] = 45; - JSparse->indexvals[151] = 46; - JSparse->indexvals[152] = 46; - JSparse->indexvals[153] = 47; - JSparse->indexvals[154] = 47; - JSparse->indexvals[155] = 48; - JSparse->indexvals[156] = 48; - JSparse->indexvals[157] = 49; - JSparse->indexvals[158] = 49; - JSparse->indexvals[159] = 50; - JSparse->indexvals[160] = 50; - JSparse->indexvals[161] = 51; - JSparse->indexvals[162] = 51; - JSparse->indexvals[163] = 52; - JSparse->indexvals[164] = 52; - JSparse->indexvals[165] = 53; - JSparse->indexvals[166] = 45; - JSparse->indexvals[167] = 53; - JSparse->indexvals[168] = 54; - JSparse->indexvals[169] = 55; - JSparse->indexvals[170] = 55; - JSparse->indexvals[171] = 56; - JSparse->indexvals[172] = 56; - JSparse->indexvals[173] = 57; - JSparse->indexvals[174] = 57; - JSparse->indexvals[175] = 58; - JSparse->indexvals[176] = 58; - JSparse->indexvals[177] = 59; - JSparse->indexvals[178] = 59; - JSparse->indexvals[179] = 60; - JSparse->indexvals[180] = 60; - JSparse->indexvals[181] = 61; - JSparse->indexvals[182] = 61; - JSparse->indexvals[183] = 62; - JSparse->indexvals[184] = 54; - JSparse->indexvals[185] = 62; - JSparse->indexvals[186] = 63; - JSparse->indexvals[187] = 64; - JSparse->indexvals[188] = 64; - JSparse->indexvals[189] = 65; - JSparse->indexvals[190] = 65; - JSparse->indexvals[191] = 66; - JSparse->indexvals[192] = 66; - JSparse->indexvals[193] = 67; - JSparse->indexvals[194] = 67; - JSparse->indexvals[195] = 68; - JSparse->indexvals[196] = 68; - JSparse->indexvals[197] = 69; - JSparse->indexvals[198] = 69; - JSparse->indexvals[199] = 70; - JSparse->indexvals[200] = 70; - JSparse->indexvals[201] = 71; - JSparse->indexvals[202] = 63; - JSparse->indexvals[203] = 71; - JSparse->indexvals[204] = 72; - JSparse->indexvals[205] = 73; - JSparse->indexvals[206] = 73; - JSparse->indexvals[207] = 74; - JSparse->indexvals[208] = 74; - JSparse->indexvals[209] = 75; - JSparse->indexvals[210] = 75; - JSparse->indexvals[211] = 76; - JSparse->indexvals[212] = 76; - JSparse->indexvals[213] = 77; - JSparse->indexvals[214] = 77; - JSparse->indexvals[215] = 78; - JSparse->indexvals[216] = 78; - JSparse->indexvals[217] = 79; - JSparse->indexvals[218] = 79; - JSparse->indexvals[219] = 80; - JSparse->indexvals[220] = 72; - JSparse->indexvals[221] = 80; - JSparse->indexvals[222] = 81; - JSparse->indexvals[223] = 82; - JSparse->indexvals[224] = 82; - JSparse->indexvals[225] = 83; - JSparse->indexvals[226] = 83; - JSparse->indexvals[227] = 84; - JSparse->indexvals[228] = 84; - JSparse->indexvals[229] = 85; - JSparse->indexvals[230] = 85; - JSparse->indexvals[231] = 86; - JSparse->indexvals[232] = 86; - JSparse->indexvals[233] = 87; - JSparse->indexvals[234] = 87; - JSparse->indexvals[235] = 88; - JSparse->indexvals[236] = 88; - JSparse->indexvals[237] = 89; - JSparse->indexvals[238] = 81; - JSparse->indexvals[239] = 89; - JSparse->indexvals[240] = 90; - JSparse->indexvals[241] = 91; - JSparse->indexvals[242] = 91; - JSparse->indexvals[243] = 92; - JSparse->indexvals[244] = 92; - JSparse->indexvals[245] = 93; - JSparse->indexvals[246] = 93; - JSparse->indexvals[247] = 94; - JSparse->indexvals[248] = 94; - JSparse->indexvals[249] = 95; - JSparse->indexvals[250] = 95; - JSparse->indexvals[251] = 96; - JSparse->indexvals[252] = 96; - JSparse->indexvals[253] = 97; - JSparse->indexvals[254] = 97; - JSparse->indexvals[255] = 98; - JSparse->indexvals[256] = 90; - JSparse->indexvals[257] = 98; - JSparse->indexvals[258] = 99; - JSparse->indexvals[259] = 100; - JSparse->indexvals[260] = 100; - JSparse->indexvals[261] = 101; - JSparse->indexvals[262] = 101; - JSparse->indexvals[263] = 102; - JSparse->indexvals[264] = 102; - JSparse->indexvals[265] = 103; - JSparse->indexvals[266] = 103; - JSparse->indexvals[267] = 104; - JSparse->indexvals[268] = 104; - JSparse->indexvals[269] = 105; - JSparse->indexvals[270] = 105; - JSparse->indexvals[271] = 106; - JSparse->indexvals[272] = 106; - JSparse->indexvals[273] = 107; - JSparse->indexvals[274] = 99; - JSparse->indexvals[275] = 107; - JSparse->indexvals[276] = 108; - JSparse->indexvals[277] = 109; - JSparse->indexvals[278] = 109; - JSparse->indexvals[279] = 110; - JSparse->indexvals[280] = 110; - JSparse->indexvals[281] = 111; - JSparse->indexvals[282] = 111; - JSparse->indexvals[283] = 112; - JSparse->indexvals[284] = 112; - JSparse->indexvals[285] = 113; - JSparse->indexvals[286] = 113; - JSparse->indexvals[287] = 114; - JSparse->indexvals[288] = 114; - JSparse->indexvals[289] = 115; - JSparse->indexvals[290] = 115; - JSparse->indexvals[291] = 116; - JSparse->indexvals[292] = 108; - JSparse->indexvals[293] = 116; - JSparse->indexvals[294] = 117; - JSparse->indexvals[295] = 118; - JSparse->indexvals[296] = 118; - JSparse->indexvals[297] = 119; - JSparse->indexvals[298] = 119; - JSparse->indexvals[299] = 120; - JSparse->indexvals[300] = 120; - JSparse->indexvals[301] = 121; - JSparse->indexvals[302] = 121; - JSparse->indexvals[303] = 122; - JSparse->indexvals[304] = 122; - JSparse->indexvals[305] = 123; - JSparse->indexvals[306] = 123; - JSparse->indexvals[307] = 124; - JSparse->indexvals[308] = 124; - JSparse->indexvals[309] = 125; - JSparse->indexvals[310] = 117; - JSparse->indexvals[311] = 125; - JSparse->indexvals[312] = 126; - JSparse->indexvals[313] = 127; - JSparse->indexvals[314] = 127; - JSparse->indexvals[315] = 128; - JSparse->indexvals[316] = 128; - JSparse->indexvals[317] = 129; - JSparse->indexvals[318] = 129; - JSparse->indexvals[319] = 130; - JSparse->indexvals[320] = 130; - JSparse->indexvals[321] = 131; - JSparse->indexvals[322] = 131; - JSparse->indexvals[323] = 132; - JSparse->indexvals[324] = 132; - JSparse->indexvals[325] = 133; - JSparse->indexvals[326] = 133; - JSparse->indexvals[327] = 134; - JSparse->indexvals[328] = 126; - JSparse->indexvals[329] = 134; - JSparse->indexvals[330] = 135; - JSparse->indexvals[331] = 136; - JSparse->indexvals[332] = 136; - JSparse->indexvals[333] = 137; - JSparse->indexvals[334] = 137; - JSparse->indexvals[335] = 138; - JSparse->indexvals[336] = 138; - JSparse->indexvals[337] = 139; - JSparse->indexvals[338] = 139; - JSparse->indexvals[339] = 140; - JSparse->indexvals[340] = 140; - JSparse->indexvals[341] = 141; - JSparse->indexvals[342] = 141; - JSparse->indexvals[343] = 142; - JSparse->indexvals[344] = 142; - JSparse->indexvals[345] = 143; - JSparse->indexvals[346] = 135; - JSparse->indexvals[347] = 143; - JSparse->indexvals[348] = 144; - JSparse->indexvals[349] = 145; - JSparse->indexvals[350] = 145; - JSparse->indexvals[351] = 146; - JSparse->indexvals[352] = 146; - JSparse->indexvals[353] = 147; - JSparse->indexvals[354] = 147; - JSparse->indexvals[355] = 148; - JSparse->indexvals[356] = 148; - JSparse->indexvals[357] = 149; - JSparse->indexvals[358] = 149; - JSparse->indexvals[359] = 150; - JSparse->indexvals[360] = 150; - JSparse->indexvals[361] = 151; - JSparse->indexvals[362] = 151; - JSparse->indexvals[363] = 152; - JSparse->indexvals[364] = 144; - JSparse->indexvals[365] = 152; - JSparse->indexvals[366] = 153; - JSparse->indexvals[367] = 154; - JSparse->indexvals[368] = 154; - JSparse->indexvals[369] = 155; - JSparse->indexvals[370] = 155; - JSparse->indexvals[371] = 156; - JSparse->indexvals[372] = 156; - JSparse->indexvals[373] = 157; - JSparse->indexvals[374] = 157; - JSparse->indexvals[375] = 158; - JSparse->indexvals[376] = 158; - JSparse->indexvals[377] = 159; - JSparse->indexvals[378] = 159; - JSparse->indexvals[379] = 160; - JSparse->indexvals[380] = 160; - JSparse->indexvals[381] = 161; - JSparse->indexvals[382] = 153; - JSparse->indexvals[383] = 161; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 14; - JSparse->indexptrs[2] = 50; - JSparse->indexptrs[3] = 54; - JSparse->indexptrs[4] = 58; - JSparse->indexptrs[5] = 62; - JSparse->indexptrs[6] = 66; - JSparse->indexptrs[7] = 70; - JSparse->indexptrs[8] = 74; - JSparse->indexptrs[9] = 78; - JSparse->indexptrs[10] = 80; - JSparse->indexptrs[11] = 82; - JSparse->indexptrs[12] = 84; - JSparse->indexptrs[13] = 86; - JSparse->indexptrs[14] = 88; - JSparse->indexptrs[15] = 90; - JSparse->indexptrs[16] = 92; - JSparse->indexptrs[17] = 94; - JSparse->indexptrs[18] = 96; - JSparse->indexptrs[19] = 98; - JSparse->indexptrs[20] = 100; - JSparse->indexptrs[21] = 102; - JSparse->indexptrs[22] = 104; - JSparse->indexptrs[23] = 106; - JSparse->indexptrs[24] = 108; - JSparse->indexptrs[25] = 110; - JSparse->indexptrs[26] = 112; - JSparse->indexptrs[27] = 114; - JSparse->indexptrs[28] = 116; - JSparse->indexptrs[29] = 118; - JSparse->indexptrs[30] = 120; - JSparse->indexptrs[31] = 122; - JSparse->indexptrs[32] = 124; - JSparse->indexptrs[33] = 126; - JSparse->indexptrs[34] = 128; - JSparse->indexptrs[35] = 130; - JSparse->indexptrs[36] = 132; - JSparse->indexptrs[37] = 134; - JSparse->indexptrs[38] = 136; - JSparse->indexptrs[39] = 138; - JSparse->indexptrs[40] = 140; - JSparse->indexptrs[41] = 142; - JSparse->indexptrs[42] = 144; - JSparse->indexptrs[43] = 146; - JSparse->indexptrs[44] = 148; - JSparse->indexptrs[45] = 150; - JSparse->indexptrs[46] = 152; - JSparse->indexptrs[47] = 154; - JSparse->indexptrs[48] = 156; - JSparse->indexptrs[49] = 158; - JSparse->indexptrs[50] = 160; - JSparse->indexptrs[51] = 162; - JSparse->indexptrs[52] = 164; - JSparse->indexptrs[53] = 166; - JSparse->indexptrs[54] = 168; - JSparse->indexptrs[55] = 170; - JSparse->indexptrs[56] = 172; - JSparse->indexptrs[57] = 174; - JSparse->indexptrs[58] = 176; - JSparse->indexptrs[59] = 178; - JSparse->indexptrs[60] = 180; - JSparse->indexptrs[61] = 182; - JSparse->indexptrs[62] = 184; - JSparse->indexptrs[63] = 186; - JSparse->indexptrs[64] = 188; - JSparse->indexptrs[65] = 190; - JSparse->indexptrs[66] = 192; - JSparse->indexptrs[67] = 194; - JSparse->indexptrs[68] = 196; - JSparse->indexptrs[69] = 198; - JSparse->indexptrs[70] = 200; - JSparse->indexptrs[71] = 202; - JSparse->indexptrs[72] = 204; - JSparse->indexptrs[73] = 206; - JSparse->indexptrs[74] = 208; - JSparse->indexptrs[75] = 210; - JSparse->indexptrs[76] = 212; - JSparse->indexptrs[77] = 214; - JSparse->indexptrs[78] = 216; - JSparse->indexptrs[79] = 218; - JSparse->indexptrs[80] = 220; - JSparse->indexptrs[81] = 222; - JSparse->indexptrs[82] = 224; - JSparse->indexptrs[83] = 226; - JSparse->indexptrs[84] = 228; - JSparse->indexptrs[85] = 230; - JSparse->indexptrs[86] = 232; - JSparse->indexptrs[87] = 234; - JSparse->indexptrs[88] = 236; - JSparse->indexptrs[89] = 238; - JSparse->indexptrs[90] = 240; - JSparse->indexptrs[91] = 242; - JSparse->indexptrs[92] = 244; - JSparse->indexptrs[93] = 246; - JSparse->indexptrs[94] = 248; - JSparse->indexptrs[95] = 250; - JSparse->indexptrs[96] = 252; - JSparse->indexptrs[97] = 254; - JSparse->indexptrs[98] = 256; - JSparse->indexptrs[99] = 258; - JSparse->indexptrs[100] = 260; - JSparse->indexptrs[101] = 262; - JSparse->indexptrs[102] = 264; - JSparse->indexptrs[103] = 266; - JSparse->indexptrs[104] = 268; - JSparse->indexptrs[105] = 270; - JSparse->indexptrs[106] = 272; - JSparse->indexptrs[107] = 274; - JSparse->indexptrs[108] = 276; - JSparse->indexptrs[109] = 278; - JSparse->indexptrs[110] = 280; - JSparse->indexptrs[111] = 282; - JSparse->indexptrs[112] = 284; - JSparse->indexptrs[113] = 286; - JSparse->indexptrs[114] = 288; - JSparse->indexptrs[115] = 290; - JSparse->indexptrs[116] = 292; - JSparse->indexptrs[117] = 294; - JSparse->indexptrs[118] = 296; - JSparse->indexptrs[119] = 298; - JSparse->indexptrs[120] = 300; - JSparse->indexptrs[121] = 302; - JSparse->indexptrs[122] = 304; - JSparse->indexptrs[123] = 306; - JSparse->indexptrs[124] = 308; - JSparse->indexptrs[125] = 310; - JSparse->indexptrs[126] = 312; - JSparse->indexptrs[127] = 314; - JSparse->indexptrs[128] = 316; - JSparse->indexptrs[129] = 318; - JSparse->indexptrs[130] = 320; - JSparse->indexptrs[131] = 322; - JSparse->indexptrs[132] = 324; - JSparse->indexptrs[133] = 326; - JSparse->indexptrs[134] = 328; - JSparse->indexptrs[135] = 330; - JSparse->indexptrs[136] = 332; - JSparse->indexptrs[137] = 334; - JSparse->indexptrs[138] = 336; - JSparse->indexptrs[139] = 338; - JSparse->indexptrs[140] = 340; - JSparse->indexptrs[141] = 342; - JSparse->indexptrs[142] = 344; - JSparse->indexptrs[143] = 346; - JSparse->indexptrs[144] = 348; - JSparse->indexptrs[145] = 350; - JSparse->indexptrs[146] = 352; - JSparse->indexptrs[147] = 354; - JSparse->indexptrs[148] = 356; - JSparse->indexptrs[149] = 358; - JSparse->indexptrs[150] = 360; - JSparse->indexptrs[151] = 362; - JSparse->indexptrs[152] = 364; - JSparse->indexptrs[153] = 366; - JSparse->indexptrs[154] = 368; - JSparse->indexptrs[155] = 370; - JSparse->indexptrs[156] = 372; - JSparse->indexptrs[157] = 374; - JSparse->indexptrs[158] = 376; - JSparse->indexptrs[159] = 378; - JSparse->indexptrs[160] = 380; - JSparse->indexptrs[161] = 382; - JSparse->indexptrs[162] = 384; - JSparse->data[0] = -k[0]*p[0]*w[0]*w[2]; - JSparse->data[1] = p[0]*w[0]; - JSparse->data[2] = -w[0]; - JSparse->data[3] = w[0]; - JSparse->data[4] = -p[0]*w[5]; - JSparse->data[5] = p[0]*w[5]; - JSparse->data[6] = -p[0]*w[6]; - JSparse->data[7] = p[0]*w[6]; - JSparse->data[8] = -p[0]*w[7]; - JSparse->data[9] = p[0]*w[7]; - JSparse->data[10] = -p[0]*w[8]; - JSparse->data[11] = p[0]*w[8]; - JSparse->data[12] = -p[0]*w[9]; - JSparse->data[13] = p[0]*w[9]; - JSparse->data[14] = p[1]*dwdx[0]*-2.0; - JSparse->data[15] = p[1]*dwdx[0]; - JSparse->data[16] = p[1]*x[10]*-4.0; - JSparse->data[17] = p[1]*x[10]*2.0; - JSparse->data[18] = dwdx[0]*-2.0-p[1]*x[19]*4.0; - JSparse->data[19] = dwdx[0]+p[1]*x[19]*2.0; - JSparse->data[20] = p[1]*x[28]*-4.0; - JSparse->data[21] = p[1]*x[28]*2.0; - JSparse->data[22] = p[1]*x[37]*-4.0; - JSparse->data[23] = p[1]*x[37]*2.0; - JSparse->data[24] = p[1]*x[46]*-4.0; - JSparse->data[25] = p[1]*x[46]*2.0; - JSparse->data[26] = p[1]*x[55]*-4.0; - JSparse->data[27] = p[1]*x[55]*2.0; - JSparse->data[28] = p[1]*x[64]*-4.0; - JSparse->data[29] = p[1]*x[64]*2.0; - JSparse->data[30] = p[1]*x[73]*-4.0; - JSparse->data[31] = p[1]*x[73]*2.0; - JSparse->data[32] = p[1]*x[82]*-4.0; - JSparse->data[33] = p[1]*x[82]*2.0; - JSparse->data[34] = p[1]*x[91]*-4.0; - JSparse->data[35] = p[1]*x[91]*2.0; - JSparse->data[36] = p[1]*x[100]*-4.0; - JSparse->data[37] = p[1]*x[100]*2.0; - JSparse->data[38] = p[1]*x[109]*-4.0; - JSparse->data[39] = p[1]*x[109]*2.0; - JSparse->data[40] = p[1]*x[118]*-4.0; - JSparse->data[41] = p[1]*x[118]*2.0; - JSparse->data[42] = p[1]*x[127]*-4.0; - JSparse->data[43] = p[1]*x[127]*2.0; - JSparse->data[44] = p[1]*x[136]*-4.0; - JSparse->data[45] = p[1]*x[136]*2.0; - JSparse->data[46] = p[1]*x[145]*-4.0; - JSparse->data[47] = p[1]*x[145]*2.0; - JSparse->data[48] = p[1]*x[154]*-4.0; - JSparse->data[49] = p[1]*x[154]*2.0; - JSparse->data[50] = -p[2]; - JSparse->data[51] = k[0]*p[2]*w[3]; - JSparse->data[52] = -1.0; - JSparse->data[53] = k[0]*w[3]; - JSparse->data[54] = -k[1]*p[3]*w[3]; - JSparse->data[55] = p[3]*dwdx[1]; - JSparse->data[56] = -1.0; - JSparse->data[57] = dwdx[1]; - JSparse->data[58] = -p[3]; - JSparse->data[59] = p[3]; - JSparse->data[60] = -1.0; - JSparse->data[61] = 1.0; - JSparse->data[62] = -p[3]; - JSparse->data[63] = p[3]; - JSparse->data[64] = -1.0; - JSparse->data[65] = 1.0; - JSparse->data[66] = -p[3]; - JSparse->data[67] = p[3]; - JSparse->data[68] = -1.0; - JSparse->data[69] = 1.0; - JSparse->data[70] = -p[3]; - JSparse->data[71] = p[3]; - JSparse->data[72] = -1.0; - JSparse->data[73] = 1.0; - JSparse->data[74] = k[1]*p[3]*w[2]; - JSparse->data[75] = -p[3]; - JSparse->data[76] = k[1]*w[2]; - JSparse->data[77] = -1.0; - JSparse->data[78] = -p[0]*w[0]; - JSparse->data[79] = p[0]*w[0]; - JSparse->data[80] = p[1]*x[1]*-4.0; - JSparse->data[81] = p[1]*x[1]*2.0; - JSparse->data[82] = -p[2]; - JSparse->data[83] = k[0]*p[2]*w[3]; - JSparse->data[84] = -p[3]; - JSparse->data[85] = p[3]*2.0; - JSparse->data[86] = -p[3]; - JSparse->data[87] = p[3]; - JSparse->data[88] = -p[3]; - JSparse->data[89] = p[3]; - JSparse->data[90] = -p[3]; - JSparse->data[91] = p[3]; - JSparse->data[92] = -p[3]; - JSparse->data[93] = p[3]; - JSparse->data[94] = k[1]*p[3]*w[2]; - JSparse->data[95] = -p[3]; - JSparse->data[96] = -p[0]*w[0]; - JSparse->data[97] = p[0]*w[0]; - JSparse->data[98] = p[1]*x[1]*-4.0; - JSparse->data[99] = p[1]*x[1]*2.0; - JSparse->data[100] = -p[2]; - JSparse->data[101] = k[0]*p[2]*w[3]; - JSparse->data[102] = -p[3]; - JSparse->data[103] = p[3]*2.0; - JSparse->data[104] = -p[3]; - JSparse->data[105] = p[3]; - JSparse->data[106] = -p[3]; - JSparse->data[107] = p[3]; - JSparse->data[108] = -p[3]; - JSparse->data[109] = p[3]; - JSparse->data[110] = -p[3]; - JSparse->data[111] = p[3]; - JSparse->data[112] = k[1]*p[3]*w[2]; - JSparse->data[113] = -p[3]; - JSparse->data[114] = -p[0]*w[0]; - JSparse->data[115] = p[0]*w[0]; - JSparse->data[116] = p[1]*x[1]*-4.0; - JSparse->data[117] = p[1]*x[1]*2.0; - JSparse->data[118] = -p[2]; - JSparse->data[119] = k[0]*p[2]*w[3]; - JSparse->data[120] = -p[3]; - JSparse->data[121] = p[3]*2.0; - JSparse->data[122] = -p[3]; - JSparse->data[123] = p[3]; - JSparse->data[124] = -p[3]; - JSparse->data[125] = p[3]; - JSparse->data[126] = -p[3]; - JSparse->data[127] = p[3]; - JSparse->data[128] = -p[3]; - JSparse->data[129] = p[3]; - JSparse->data[130] = k[1]*p[3]*w[2]; - JSparse->data[131] = -p[3]; - JSparse->data[132] = -p[0]*w[0]; - JSparse->data[133] = p[0]*w[0]; - JSparse->data[134] = p[1]*x[1]*-4.0; - JSparse->data[135] = p[1]*x[1]*2.0; - JSparse->data[136] = -p[2]; - JSparse->data[137] = k[0]*p[2]*w[3]; - JSparse->data[138] = -p[3]; - JSparse->data[139] = p[3]*2.0; - JSparse->data[140] = -p[3]; - JSparse->data[141] = p[3]; - JSparse->data[142] = -p[3]; - JSparse->data[143] = p[3]; - JSparse->data[144] = -p[3]; - JSparse->data[145] = p[3]; - JSparse->data[146] = -p[3]; - JSparse->data[147] = p[3]; - JSparse->data[148] = k[1]*p[3]*w[2]; - JSparse->data[149] = -p[3]; - JSparse->data[150] = -p[0]*w[0]; - JSparse->data[151] = p[0]*w[0]; - JSparse->data[152] = p[1]*x[1]*-4.0; - JSparse->data[153] = p[1]*x[1]*2.0; - JSparse->data[154] = -p[2]; - JSparse->data[155] = k[0]*p[2]*w[3]; - JSparse->data[156] = -p[3]; - JSparse->data[157] = p[3]*2.0; - JSparse->data[158] = -p[3]; - JSparse->data[159] = p[3]; - JSparse->data[160] = -p[3]; - JSparse->data[161] = p[3]; - JSparse->data[162] = -p[3]; - JSparse->data[163] = p[3]; - JSparse->data[164] = -p[3]; - JSparse->data[165] = p[3]; - JSparse->data[166] = k[1]*p[3]*w[2]; - JSparse->data[167] = -p[3]; - JSparse->data[168] = -p[0]*w[0]; - JSparse->data[169] = p[0]*w[0]; - JSparse->data[170] = p[1]*x[1]*-4.0; - JSparse->data[171] = p[1]*x[1]*2.0; - JSparse->data[172] = -p[2]; - JSparse->data[173] = k[0]*p[2]*w[3]; - JSparse->data[174] = -p[3]; - JSparse->data[175] = p[3]*2.0; - JSparse->data[176] = -p[3]; - JSparse->data[177] = p[3]; - JSparse->data[178] = -p[3]; - JSparse->data[179] = p[3]; - JSparse->data[180] = -p[3]; - JSparse->data[181] = p[3]; - JSparse->data[182] = -p[3]; - JSparse->data[183] = p[3]; - JSparse->data[184] = k[1]*p[3]*w[2]; - JSparse->data[185] = -p[3]; - JSparse->data[186] = -p[0]*w[0]; - JSparse->data[187] = p[0]*w[0]; - JSparse->data[188] = p[1]*x[1]*-4.0; - JSparse->data[189] = p[1]*x[1]*2.0; - JSparse->data[190] = -p[2]; - JSparse->data[191] = k[0]*p[2]*w[3]; - JSparse->data[192] = -p[3]; - JSparse->data[193] = p[3]*2.0; - JSparse->data[194] = -p[3]; - JSparse->data[195] = p[3]; - JSparse->data[196] = -p[3]; - JSparse->data[197] = p[3]; - JSparse->data[198] = -p[3]; - JSparse->data[199] = p[3]; - JSparse->data[200] = -p[3]; - JSparse->data[201] = p[3]; - JSparse->data[202] = k[1]*p[3]*w[2]; - JSparse->data[203] = -p[3]; - JSparse->data[204] = -p[0]*w[0]; - JSparse->data[205] = p[0]*w[0]; - JSparse->data[206] = p[1]*x[1]*-4.0; - JSparse->data[207] = p[1]*x[1]*2.0; - JSparse->data[208] = -p[2]; - JSparse->data[209] = k[0]*p[2]*w[3]; - JSparse->data[210] = -p[3]; - JSparse->data[211] = p[3]*2.0; - JSparse->data[212] = -p[3]; - JSparse->data[213] = p[3]; - JSparse->data[214] = -p[3]; - JSparse->data[215] = p[3]; - JSparse->data[216] = -p[3]; - JSparse->data[217] = p[3]; - JSparse->data[218] = -p[3]; - JSparse->data[219] = p[3]; - JSparse->data[220] = k[1]*p[3]*w[2]; - JSparse->data[221] = -p[3]; - JSparse->data[222] = -p[0]*w[0]; - JSparse->data[223] = p[0]*w[0]; - JSparse->data[224] = p[1]*x[1]*-4.0; - JSparse->data[225] = p[1]*x[1]*2.0; - JSparse->data[226] = -p[2]; - JSparse->data[227] = k[0]*p[2]*w[3]; - JSparse->data[228] = -p[3]; - JSparse->data[229] = p[3]*2.0; - JSparse->data[230] = -p[3]; - JSparse->data[231] = p[3]; - JSparse->data[232] = -p[3]; - JSparse->data[233] = p[3]; - JSparse->data[234] = -p[3]; - JSparse->data[235] = p[3]; - JSparse->data[236] = -p[3]; - JSparse->data[237] = p[3]; - JSparse->data[238] = k[1]*p[3]*w[2]; - JSparse->data[239] = -p[3]; - JSparse->data[240] = -p[0]*w[0]; - JSparse->data[241] = p[0]*w[0]; - JSparse->data[242] = p[1]*x[1]*-4.0; - JSparse->data[243] = p[1]*x[1]*2.0; - JSparse->data[244] = -p[2]; - JSparse->data[245] = k[0]*p[2]*w[3]; - JSparse->data[246] = -p[3]; - JSparse->data[247] = p[3]*2.0; - JSparse->data[248] = -p[3]; - JSparse->data[249] = p[3]; - JSparse->data[250] = -p[3]; - JSparse->data[251] = p[3]; - JSparse->data[252] = -p[3]; - JSparse->data[253] = p[3]; - JSparse->data[254] = -p[3]; - JSparse->data[255] = p[3]; - JSparse->data[256] = k[1]*p[3]*w[2]; - JSparse->data[257] = -p[3]; - JSparse->data[258] = -p[0]*w[0]; - JSparse->data[259] = p[0]*w[0]; - JSparse->data[260] = p[1]*x[1]*-4.0; - JSparse->data[261] = p[1]*x[1]*2.0; - JSparse->data[262] = -p[2]; - JSparse->data[263] = k[0]*p[2]*w[3]; - JSparse->data[264] = -p[3]; - JSparse->data[265] = p[3]*2.0; - JSparse->data[266] = -p[3]; - JSparse->data[267] = p[3]; - JSparse->data[268] = -p[3]; - JSparse->data[269] = p[3]; - JSparse->data[270] = -p[3]; - JSparse->data[271] = p[3]; - JSparse->data[272] = -p[3]; - JSparse->data[273] = p[3]; - JSparse->data[274] = k[1]*p[3]*w[2]; - JSparse->data[275] = -p[3]; - JSparse->data[276] = -p[0]*w[0]; - JSparse->data[277] = p[0]*w[0]; - JSparse->data[278] = p[1]*x[1]*-4.0; - JSparse->data[279] = p[1]*x[1]*2.0; - JSparse->data[280] = -p[2]; - JSparse->data[281] = k[0]*p[2]*w[3]; - JSparse->data[282] = -p[3]; - JSparse->data[283] = p[3]*2.0; - JSparse->data[284] = -p[3]; - JSparse->data[285] = p[3]; - JSparse->data[286] = -p[3]; - JSparse->data[287] = p[3]; - JSparse->data[288] = -p[3]; - JSparse->data[289] = p[3]; - JSparse->data[290] = -p[3]; - JSparse->data[291] = p[3]; - JSparse->data[292] = k[1]*p[3]*w[2]; - JSparse->data[293] = -p[3]; - JSparse->data[294] = -p[0]*w[0]; - JSparse->data[295] = p[0]*w[0]; - JSparse->data[296] = p[1]*x[1]*-4.0; - JSparse->data[297] = p[1]*x[1]*2.0; - JSparse->data[298] = -p[2]; - JSparse->data[299] = k[0]*p[2]*w[3]; - JSparse->data[300] = -p[3]; - JSparse->data[301] = p[3]*2.0; - JSparse->data[302] = -p[3]; - JSparse->data[303] = p[3]; - JSparse->data[304] = -p[3]; - JSparse->data[305] = p[3]; - JSparse->data[306] = -p[3]; - JSparse->data[307] = p[3]; - JSparse->data[308] = -p[3]; - JSparse->data[309] = p[3]; - JSparse->data[310] = k[1]*p[3]*w[2]; - JSparse->data[311] = -p[3]; - JSparse->data[312] = -p[0]*w[0]; - JSparse->data[313] = p[0]*w[0]; - JSparse->data[314] = p[1]*x[1]*-4.0; - JSparse->data[315] = p[1]*x[1]*2.0; - JSparse->data[316] = -p[2]; - JSparse->data[317] = k[0]*p[2]*w[3]; - JSparse->data[318] = -p[3]; - JSparse->data[319] = p[3]*2.0; - JSparse->data[320] = -p[3]; - JSparse->data[321] = p[3]; - JSparse->data[322] = -p[3]; - JSparse->data[323] = p[3]; - JSparse->data[324] = -p[3]; - JSparse->data[325] = p[3]; - JSparse->data[326] = -p[3]; - JSparse->data[327] = p[3]; - JSparse->data[328] = k[1]*p[3]*w[2]; - JSparse->data[329] = -p[3]; - JSparse->data[330] = -p[0]*w[0]; - JSparse->data[331] = p[0]*w[0]; - JSparse->data[332] = p[1]*x[1]*-4.0; - JSparse->data[333] = p[1]*x[1]*2.0; - JSparse->data[334] = -p[2]; - JSparse->data[335] = k[0]*p[2]*w[3]; - JSparse->data[336] = -p[3]; - JSparse->data[337] = p[3]*2.0; - JSparse->data[338] = -p[3]; - JSparse->data[339] = p[3]; - JSparse->data[340] = -p[3]; - JSparse->data[341] = p[3]; - JSparse->data[342] = -p[3]; - JSparse->data[343] = p[3]; - JSparse->data[344] = -p[3]; - JSparse->data[345] = p[3]; - JSparse->data[346] = k[1]*p[3]*w[2]; - JSparse->data[347] = -p[3]; - JSparse->data[348] = -p[0]*w[0]; - JSparse->data[349] = p[0]*w[0]; - JSparse->data[350] = p[1]*x[1]*-4.0; - JSparse->data[351] = p[1]*x[1]*2.0; - JSparse->data[352] = -p[2]; - JSparse->data[353] = k[0]*p[2]*w[3]; - JSparse->data[354] = -p[3]; - JSparse->data[355] = p[3]*2.0; - JSparse->data[356] = -p[3]; - JSparse->data[357] = p[3]; - JSparse->data[358] = -p[3]; - JSparse->data[359] = p[3]; - JSparse->data[360] = -p[3]; - JSparse->data[361] = p[3]; - JSparse->data[362] = -p[3]; - JSparse->data[363] = p[3]; - JSparse->data[364] = k[1]*p[3]*w[2]; - JSparse->data[365] = -p[3]; - JSparse->data[366] = -p[0]*w[0]; - JSparse->data[367] = p[0]*w[0]; - JSparse->data[368] = p[1]*x[1]*-4.0; - JSparse->data[369] = p[1]*x[1]*2.0; - JSparse->data[370] = -p[2]; - JSparse->data[371] = k[0]*p[2]*w[3]; - JSparse->data[372] = -p[3]; - JSparse->data[373] = p[3]*2.0; - JSparse->data[374] = -p[3]; - JSparse->data[375] = p[3]; - JSparse->data[376] = -p[3]; - JSparse->data[377] = p[3]; - JSparse->data[378] = -p[3]; - JSparse->data[379] = p[3]; - JSparse->data[380] = -p[3]; - JSparse->data[381] = p[3]; - JSparse->data[382] = k[1]*p[3]*w[2]; - JSparse->data[383] = -p[3]; -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/Jy.cpp b/models/model_jakstat_adjoint_o2/Jy.cpp deleted file mode 100644 index 63abdf4b43..0000000000 --- a/models/model_jakstat_adjoint_o2/Jy.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void Jy_model_jakstat_adjoint_o2(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - nllh[1] = y[3]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[2] = y[6]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[3] = y[9]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[4] = y[12]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[5] = y[15]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[6] = y[18]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[7] = y[21]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[8] = y[24]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[9] = y[27]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[10] = y[30]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[11] = y[33]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[12] = y[36]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[13] = y[39]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[14] = y[42]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[15] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*-1.0+1.0/sigmay[0]-y[45]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*5.0E-1; - nllh[16] = y[48]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[17] = y[51]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; - case 1: - nllh[0] = amici::log((sigmay[1]*sigmay[1])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*5.0E-1; - nllh[1] = y[4]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[2] = y[7]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[3] = y[10]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[4] = y[13]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[5] = y[16]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[6] = y[19]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[7] = y[22]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[8] = y[25]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[9] = y[28]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[10] = y[31]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[11] = y[34]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[12] = y[37]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[13] = y[40]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[14] = y[43]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[15] = y[46]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - nllh[16] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*-1.0+1.0/sigmay[1]-y[49]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*5.0E-1; - nllh[17] = y[52]*1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - break; - case 2: - nllh[0] = amici::log((sigmay[2]*sigmay[2])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*5.0E-1; - nllh[1] = y[5]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[2] = y[8]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[3] = y[11]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[4] = y[14]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[5] = y[17]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[6] = y[20]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[7] = y[23]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[8] = y[26]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[9] = y[29]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[10] = y[32]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[11] = y[35]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[12] = y[38]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[13] = y[41]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[14] = y[44]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[15] = y[47]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[16] = y[50]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - nllh[17] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*-1.0+1.0/sigmay[2]-y[53]*1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dJydsigma.cpp b/models/model_jakstat_adjoint_o2/dJydsigma.cpp deleted file mode 100644 index 0a3c94610e..0000000000 --- a/models/model_jakstat_adjoint_o2/dJydsigma.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dJydsigma_model_jakstat_adjoint_o2(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0+0*18] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*-1.0+1.0/sigmay[0]; - dJydsigma[1+0*18] = y[3]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[2+0*18] = y[6]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[3+0*18] = y[9]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[4+0*18] = y[12]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[5+0*18] = y[15]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[6+0*18] = y[18]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[7+0*18] = y[21]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[8+0*18] = y[24]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[9+0*18] = y[27]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[10+0*18] = y[30]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[11+0*18] = y[33]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[12+0*18] = y[36]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[13+0*18] = y[39]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[14+0*18] = y[42]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[15+0*18] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*3.0-1.0/(sigmay[0]*sigmay[0])*1.0+y[45]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[16+0*18] = y[48]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[17+0*18] = y[51]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - break; - case 1: - dJydsigma[0+1*18] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*-1.0+1.0/sigmay[1]; - dJydsigma[1+1*18] = y[4]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[2+1*18] = y[7]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[3+1*18] = y[10]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[4+1*18] = y[13]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[5+1*18] = y[16]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[6+1*18] = y[19]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[7+1*18] = y[22]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[8+1*18] = y[25]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[9+1*18] = y[28]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[10+1*18] = y[31]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[11+1*18] = y[34]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[12+1*18] = y[37]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[13+1*18] = y[40]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[14+1*18] = y[43]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[15+1*18] = y[46]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[16+1*18] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*3.0-1.0/(sigmay[1]*sigmay[1])*1.0+y[49]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - dJydsigma[17+1*18] = y[52]*1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0; - break; - case 2: - dJydsigma[0+2*18] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*-1.0+1.0/sigmay[2]; - dJydsigma[1+2*18] = y[5]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[2+2*18] = y[8]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[3+2*18] = y[11]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[4+2*18] = y[14]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[5+2*18] = y[17]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[6+2*18] = y[20]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[7+2*18] = y[23]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[8+2*18] = y[26]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[9+2*18] = y[29]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[10+2*18] = y[32]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[11+2*18] = y[35]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[12+2*18] = y[38]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[13+2*18] = y[41]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[14+2*18] = y[44]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[15+2*18] = y[47]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[16+2*18] = y[50]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - dJydsigma[17+2*18] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*3.0-1.0/(sigmay[2]*sigmay[2])*1.0+y[53]*1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0; - break; -} -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dJydy.cpp b/models/model_jakstat_adjoint_o2/dJydy.cpp deleted file mode 100644 index f940654cda..0000000000 --- a/models/model_jakstat_adjoint_o2/dJydy.cpp +++ /dev/null @@ -1,132 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dJydy_model_jakstat_adjoint_o2(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0+0*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[1+0*18] = y[3]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[1+3*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[2+0*18] = y[6]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[2+6*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[3+0*18] = y[9]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[3+9*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[4+0*18] = y[12]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[4+12*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[5+0*18] = y[15]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[5+15*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[6+0*18] = y[18]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[6+18*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[7+0*18] = y[21]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[7+21*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[8+0*18] = y[24]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[8+24*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[9+0*18] = y[27]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[9+27*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[10+0*18] = y[30]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[10+30*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[11+0*18] = y[33]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[11+33*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[12+0*18] = y[36]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[12+36*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[13+0*18] = y[39]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[13+39*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[14+0*18] = y[42]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[14+42*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[15+0*18] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0+y[45]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[15+45*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[16+0*18] = y[48]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[16+48*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[17+0*18] = y[51]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[17+51*18] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; - case 1: - dJydy[0+1*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[1+1*18] = y[4]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[1+4*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[2+1*18] = y[7]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[2+7*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[3+1*18] = y[10]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[3+10*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[4+1*18] = y[13]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[4+13*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[5+1*18] = y[16]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[5+16*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[6+1*18] = y[19]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[6+19*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[7+1*18] = y[22]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[7+22*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[8+1*18] = y[25]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[8+25*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[9+1*18] = y[28]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[9+28*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[10+1*18] = y[31]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[10+31*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[11+1*18] = y[34]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[11+34*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[12+1*18] = y[37]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[12+37*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[13+1*18] = y[40]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[13+40*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[14+1*18] = y[43]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[14+43*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[15+1*18] = y[46]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[15+46*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[16+1*18] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*1.0+y[49]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[16+49*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - dJydy[17+1*18] = y[52]*1.0/(sigmay[1]*sigmay[1])*1.0; - dJydy[17+52*18] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - break; - case 2: - dJydy[0+2*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[1+2*18] = y[5]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[1+5*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[2+2*18] = y[8]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[2+8*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[3+2*18] = y[11]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[3+11*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[4+2*18] = y[14]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[4+14*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[5+2*18] = y[17]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[5+17*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[6+2*18] = y[20]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[6+20*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[7+2*18] = y[23]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[7+23*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[8+2*18] = y[26]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[8+26*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[9+2*18] = y[29]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[9+29*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[10+2*18] = y[32]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[10+32*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[11+2*18] = y[35]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[11+35*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[12+2*18] = y[38]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[12+38*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[13+2*18] = y[41]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[13+41*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[14+2*18] = y[44]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[14+44*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[15+2*18] = y[47]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[15+47*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[16+2*18] = y[50]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[16+50*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - dJydy[17+2*18] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*1.0+y[53]*1.0/(sigmay[2]*sigmay[2])*1.0; - dJydy[17+53*18] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dsigmaydp.cpp b/models/model_jakstat_adjoint_o2/dsigmaydp.cpp deleted file mode 100644 index ac9cb8730d..0000000000 --- a/models/model_jakstat_adjoint_o2/dsigmaydp.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dsigmaydp_model_jakstat_adjoint_o2(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) { -switch (ip) { - case 14: { - dsigmaydp[0] = 1.0; - - } break; - - case 15: { - dsigmaydp[1] = 1.0; - - } break; - - case 16: { - dsigmaydp[2] = 1.0; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dwdp.cpp b/models/model_jakstat_adjoint_o2/dwdp.cpp deleted file mode 100644 index a936666e39..0000000000 --- a/models/model_jakstat_adjoint_o2/dwdp.cpp +++ /dev/null @@ -1,49 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dwdp_model_jakstat_adjoint_o2(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) { - dwdp[0] = amici::Dspline_pos(4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[1] = amici::DDspline_pos(4,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[2] = amici::DDspline_pos(6,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[3] = amici::DDspline_pos(8,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[4] = amici::DDspline_pos(10,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[5] = amici::DDspline_pos(12,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[6] = amici::Dspline_pos(6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[7] = amici::DDspline_pos(6,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[8] = amici::DDspline_pos(6,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[9] = amici::DDspline_pos(8,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[10] = amici::DDspline_pos(10,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[11] = amici::DDspline_pos(12,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[12] = amici::Dspline_pos(8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[13] = amici::DDspline_pos(8,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[14] = amici::DDspline_pos(8,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[15] = amici::DDspline_pos(8,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[16] = amici::DDspline_pos(10,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[17] = amici::DDspline_pos(12,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[18] = amici::Dspline_pos(10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[19] = amici::DDspline_pos(10,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[20] = amici::DDspline_pos(10,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[21] = amici::DDspline_pos(10,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[22] = amici::DDspline_pos(10,10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[23] = amici::DDspline_pos(12,10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[24] = amici::Dspline_pos(12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[25] = amici::DDspline_pos(12,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[26] = amici::DDspline_pos(12,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[27] = amici::DDspline_pos(12,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[28] = amici::DDspline_pos(12,10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dwdp[29] = amici::DDspline_pos(12,12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dwdx.cpp b/models/model_jakstat_adjoint_o2/dwdx.cpp deleted file mode 100644 index 81ad6343f1..0000000000 --- a/models/model_jakstat_adjoint_o2/dwdx.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dwdx_model_jakstat_adjoint_o2(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) { - dwdx[0] = x[1]*2.0; - dwdx[1] = 2.0; -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dxdotdp.cpp b/models/model_jakstat_adjoint_o2/dxdotdp.cpp deleted file mode 100644 index 0f806991ce..0000000000 --- a/models/model_jakstat_adjoint_o2/dxdotdp.cpp +++ /dev/null @@ -1,471 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dxdotdp_model_jakstat_adjoint_o2(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[0] = -k[0]*w[0]*x[0]*w[2]; - dxdotdp[1] = w[0]*x[0]; - dxdotdp[9] = -w[0]*x[9]; - dxdotdp[10] = w[0]*x[9]; - dxdotdp[18] = -w[0]*x[18]; - dxdotdp[19] = w[0]*x[18]; - dxdotdp[27] = -w[0]*x[27]; - dxdotdp[28] = w[0]*x[27]; - dxdotdp[36] = -w[0]*x[36]; - dxdotdp[37] = w[0]*x[36]; - dxdotdp[45] = -w[0]*x[45]; - dxdotdp[46] = w[0]*x[45]; - dxdotdp[54] = -x[0]*w[5]-w[0]*x[54]; - dxdotdp[55] = x[0]*w[5]+w[0]*x[54]; - dxdotdp[63] = -x[0]*w[6]-w[0]*x[63]; - dxdotdp[64] = x[0]*w[6]+w[0]*x[63]; - dxdotdp[72] = -x[0]*w[7]-w[0]*x[72]; - dxdotdp[73] = x[0]*w[7]+w[0]*x[72]; - dxdotdp[81] = -x[0]*w[8]-w[0]*x[81]; - dxdotdp[82] = x[0]*w[8]+w[0]*x[81]; - dxdotdp[90] = -x[0]*w[9]-w[0]*x[90]; - dxdotdp[91] = x[0]*w[9]+w[0]*x[90]; - dxdotdp[99] = -w[0]*x[99]; - dxdotdp[100] = w[0]*x[99]; - dxdotdp[108] = -w[0]*x[108]; - dxdotdp[109] = w[0]*x[108]; - dxdotdp[117] = -w[0]*x[117]; - dxdotdp[118] = w[0]*x[117]; - dxdotdp[126] = -w[0]*x[126]; - dxdotdp[127] = w[0]*x[126]; - dxdotdp[135] = -w[0]*x[135]; - dxdotdp[136] = w[0]*x[135]; - dxdotdp[144] = -w[0]*x[144]; - dxdotdp[145] = w[0]*x[144]; - dxdotdp[153] = -w[0]*x[153]; - dxdotdp[154] = w[0]*x[153]; - - } break; - - case 1: { - dxdotdp[1] = w[1]*-2.0; - dxdotdp[2] = w[1]; - dxdotdp[10] = x[1]*x[10]*-4.0; - dxdotdp[11] = x[1]*x[10]*2.0; - dxdotdp[19] = x[1]*x[19]*-4.0; - dxdotdp[20] = x[1]*x[19]*2.0; - dxdotdp[28] = x[1]*x[28]*-4.0; - dxdotdp[29] = x[1]*x[28]*2.0; - dxdotdp[37] = x[1]*x[37]*-4.0; - dxdotdp[38] = x[1]*x[37]*2.0; - dxdotdp[46] = x[1]*x[46]*-4.0; - dxdotdp[47] = x[1]*x[46]*2.0; - dxdotdp[55] = x[1]*x[55]*-4.0; - dxdotdp[56] = x[1]*x[55]*2.0; - dxdotdp[64] = x[1]*x[64]*-4.0; - dxdotdp[65] = x[1]*x[64]*2.0; - dxdotdp[73] = x[1]*x[73]*-4.0; - dxdotdp[74] = x[1]*x[73]*2.0; - dxdotdp[82] = x[1]*x[82]*-4.0; - dxdotdp[83] = x[1]*x[82]*2.0; - dxdotdp[91] = x[1]*x[91]*-4.0; - dxdotdp[92] = x[1]*x[91]*2.0; - dxdotdp[100] = x[1]*x[100]*-4.0; - dxdotdp[101] = x[1]*x[100]*2.0; - dxdotdp[109] = x[1]*x[109]*-4.0; - dxdotdp[110] = x[1]*x[109]*2.0; - dxdotdp[118] = x[1]*x[118]*-4.0; - dxdotdp[119] = x[1]*x[118]*2.0; - dxdotdp[127] = x[1]*x[127]*-4.0; - dxdotdp[128] = x[1]*x[127]*2.0; - dxdotdp[136] = x[1]*x[136]*-4.0; - dxdotdp[137] = x[1]*x[136]*2.0; - dxdotdp[145] = x[1]*x[145]*-4.0; - dxdotdp[146] = x[1]*x[145]*2.0; - dxdotdp[154] = x[1]*x[154]*-4.0; - dxdotdp[155] = x[1]*x[154]*2.0; - - } break; - - case 2: { - dxdotdp[2] = -x[2]; - dxdotdp[3] = k[0]*w[3]*x[2]; - dxdotdp[11] = -x[11]; - dxdotdp[12] = k[0]*w[3]*x[11]; - dxdotdp[20] = -x[20]; - dxdotdp[21] = k[0]*w[3]*x[20]; - dxdotdp[29] = -x[29]; - dxdotdp[30] = k[0]*w[3]*x[29]; - dxdotdp[38] = -x[38]; - dxdotdp[39] = k[0]*w[3]*x[38]; - dxdotdp[47] = -x[47]; - dxdotdp[48] = k[0]*w[3]*x[47]; - dxdotdp[56] = -x[56]; - dxdotdp[57] = k[0]*w[3]*x[56]; - dxdotdp[65] = -x[65]; - dxdotdp[66] = k[0]*w[3]*x[65]; - dxdotdp[74] = -x[74]; - dxdotdp[75] = k[0]*w[3]*x[74]; - dxdotdp[83] = -x[83]; - dxdotdp[84] = k[0]*w[3]*x[83]; - dxdotdp[92] = -x[92]; - dxdotdp[93] = k[0]*w[3]*x[92]; - dxdotdp[101] = -x[101]; - dxdotdp[102] = k[0]*w[3]*x[101]; - dxdotdp[110] = -x[110]; - dxdotdp[111] = k[0]*w[3]*x[110]; - dxdotdp[119] = -x[119]; - dxdotdp[120] = k[0]*w[3]*x[119]; - dxdotdp[128] = -x[128]; - dxdotdp[129] = k[0]*w[3]*x[128]; - dxdotdp[137] = -x[137]; - dxdotdp[138] = k[0]*w[3]*x[137]; - dxdotdp[146] = -x[146]; - dxdotdp[147] = k[0]*w[3]*x[146]; - dxdotdp[155] = -x[155]; - dxdotdp[156] = k[0]*w[3]*x[155]; - - } break; - - case 3: { - dxdotdp[0] = k[1]*w[2]*x[8]; - dxdotdp[3] = -k[1]*w[3]*x[3]; - dxdotdp[4] = w[4]-x[4]; - dxdotdp[5] = x[4]-x[5]; - dxdotdp[6] = x[5]-x[6]; - dxdotdp[7] = x[6]-x[7]; - dxdotdp[8] = x[7]-x[8]; - dxdotdp[9] = k[1]*w[2]*x[17]; - dxdotdp[12] = -x[12]; - dxdotdp[13] = x[12]*2.0-x[13]; - dxdotdp[14] = x[13]-x[14]; - dxdotdp[15] = x[14]-x[15]; - dxdotdp[16] = x[15]-x[16]; - dxdotdp[17] = x[16]-x[17]; - dxdotdp[18] = k[1]*w[2]*x[26]; - dxdotdp[21] = -x[21]; - dxdotdp[22] = x[21]*2.0-x[22]; - dxdotdp[23] = x[22]-x[23]; - dxdotdp[24] = x[23]-x[24]; - dxdotdp[25] = x[24]-x[25]; - dxdotdp[26] = x[25]-x[26]; - dxdotdp[27] = k[1]*w[2]*x[35]; - dxdotdp[30] = -x[30]; - dxdotdp[31] = x[30]*2.0-x[31]; - dxdotdp[32] = x[31]-x[32]; - dxdotdp[33] = x[32]-x[33]; - dxdotdp[34] = x[33]-x[34]; - dxdotdp[35] = x[34]-x[35]; - dxdotdp[36] = k[1]*w[2]*x[44]; - dxdotdp[39] = -x[39]; - dxdotdp[40] = x[39]*2.0-x[40]; - dxdotdp[41] = x[40]-x[41]; - dxdotdp[42] = x[41]-x[42]; - dxdotdp[43] = x[42]-x[43]; - dxdotdp[44] = x[43]-x[44]; - dxdotdp[45] = k[1]*w[2]*x[53]; - dxdotdp[48] = -x[48]; - dxdotdp[49] = x[48]*2.0-x[49]; - dxdotdp[50] = x[49]-x[50]; - dxdotdp[51] = x[50]-x[51]; - dxdotdp[52] = x[51]-x[52]; - dxdotdp[53] = x[52]-x[53]; - dxdotdp[54] = k[1]*w[2]*x[62]; - dxdotdp[57] = -x[57]; - dxdotdp[58] = x[57]*2.0-x[58]; - dxdotdp[59] = x[58]-x[59]; - dxdotdp[60] = x[59]-x[60]; - dxdotdp[61] = x[60]-x[61]; - dxdotdp[62] = x[61]-x[62]; - dxdotdp[63] = k[1]*w[2]*x[71]; - dxdotdp[66] = -x[66]; - dxdotdp[67] = x[66]*2.0-x[67]; - dxdotdp[68] = x[67]-x[68]; - dxdotdp[69] = x[68]-x[69]; - dxdotdp[70] = x[69]-x[70]; - dxdotdp[71] = x[70]-x[71]; - dxdotdp[72] = k[1]*w[2]*x[80]; - dxdotdp[75] = -x[75]; - dxdotdp[76] = x[75]*2.0-x[76]; - dxdotdp[77] = x[76]-x[77]; - dxdotdp[78] = x[77]-x[78]; - dxdotdp[79] = x[78]-x[79]; - dxdotdp[80] = x[79]-x[80]; - dxdotdp[81] = k[1]*w[2]*x[89]; - dxdotdp[84] = -x[84]; - dxdotdp[85] = x[84]*2.0-x[85]; - dxdotdp[86] = x[85]-x[86]; - dxdotdp[87] = x[86]-x[87]; - dxdotdp[88] = x[87]-x[88]; - dxdotdp[89] = x[88]-x[89]; - dxdotdp[90] = k[1]*w[2]*x[98]; - dxdotdp[93] = -x[93]; - dxdotdp[94] = x[93]*2.0-x[94]; - dxdotdp[95] = x[94]-x[95]; - dxdotdp[96] = x[95]-x[96]; - dxdotdp[97] = x[96]-x[97]; - dxdotdp[98] = x[97]-x[98]; - dxdotdp[99] = k[1]*w[2]*x[107]; - dxdotdp[102] = -x[102]; - dxdotdp[103] = x[102]*2.0-x[103]; - dxdotdp[104] = x[103]-x[104]; - dxdotdp[105] = x[104]-x[105]; - dxdotdp[106] = x[105]-x[106]; - dxdotdp[107] = x[106]-x[107]; - dxdotdp[108] = k[1]*w[2]*x[116]; - dxdotdp[111] = -x[111]; - dxdotdp[112] = x[111]*2.0-x[112]; - dxdotdp[113] = x[112]-x[113]; - dxdotdp[114] = x[113]-x[114]; - dxdotdp[115] = x[114]-x[115]; - dxdotdp[116] = x[115]-x[116]; - dxdotdp[117] = k[1]*w[2]*x[125]; - dxdotdp[120] = -x[120]; - dxdotdp[121] = x[120]*2.0-x[121]; - dxdotdp[122] = x[121]-x[122]; - dxdotdp[123] = x[122]-x[123]; - dxdotdp[124] = x[123]-x[124]; - dxdotdp[125] = x[124]-x[125]; - dxdotdp[126] = k[1]*w[2]*x[134]; - dxdotdp[129] = -x[129]; - dxdotdp[130] = x[129]*2.0-x[130]; - dxdotdp[131] = x[130]-x[131]; - dxdotdp[132] = x[131]-x[132]; - dxdotdp[133] = x[132]-x[133]; - dxdotdp[134] = x[133]-x[134]; - dxdotdp[135] = k[1]*w[2]*x[143]; - dxdotdp[138] = -x[138]; - dxdotdp[139] = x[138]*2.0-x[139]; - dxdotdp[140] = x[139]-x[140]; - dxdotdp[141] = x[140]-x[141]; - dxdotdp[142] = x[141]-x[142]; - dxdotdp[143] = x[142]-x[143]; - dxdotdp[144] = k[1]*w[2]*x[152]; - dxdotdp[147] = -x[147]; - dxdotdp[148] = x[147]*2.0-x[148]; - dxdotdp[149] = x[148]-x[149]; - dxdotdp[150] = x[149]-x[150]; - dxdotdp[151] = x[150]-x[151]; - dxdotdp[152] = x[151]-x[152]; - dxdotdp[153] = k[1]*w[2]*x[161]; - dxdotdp[156] = -x[156]; - dxdotdp[157] = x[156]*2.0-x[157]; - dxdotdp[158] = x[157]-x[158]; - dxdotdp[159] = x[158]-x[159]; - dxdotdp[160] = x[159]-x[160]; - dxdotdp[161] = x[160]-x[161]; - - } break; - - case 5: { - dxdotdp[0] = -k[0]*p[0]*x[0]*w[2]*dwdp[0]; - dxdotdp[1] = p[0]*x[0]*dwdp[0]; - dxdotdp[9] = -dwdp[0]*(x[0]+p[0]*x[9]); - dxdotdp[10] = dwdp[0]*(x[0]+p[0]*x[9]); - dxdotdp[18] = -p[0]*x[18]*dwdp[0]; - dxdotdp[19] = p[0]*x[18]*dwdp[0]; - dxdotdp[27] = -p[0]*x[27]*dwdp[0]; - dxdotdp[28] = p[0]*x[27]*dwdp[0]; - dxdotdp[36] = -p[0]*x[36]*dwdp[0]; - dxdotdp[37] = p[0]*x[36]*dwdp[0]; - dxdotdp[45] = -p[0]*x[45]*dwdp[0]; - dxdotdp[46] = p[0]*x[45]*dwdp[0]; - dxdotdp[54] = -p[0]*x[0]*dwdp[1]-p[0]*x[54]*dwdp[0]; - dxdotdp[55] = p[0]*x[0]*dwdp[1]+p[0]*x[54]*dwdp[0]; - dxdotdp[63] = -p[0]*x[0]*dwdp[2]-p[0]*x[63]*dwdp[0]; - dxdotdp[64] = p[0]*x[0]*dwdp[2]+p[0]*x[63]*dwdp[0]; - dxdotdp[72] = -p[0]*x[0]*dwdp[3]-p[0]*x[72]*dwdp[0]; - dxdotdp[73] = p[0]*x[0]*dwdp[3]+p[0]*x[72]*dwdp[0]; - dxdotdp[81] = -p[0]*x[0]*dwdp[4]-p[0]*x[81]*dwdp[0]; - dxdotdp[82] = p[0]*x[0]*dwdp[4]+p[0]*x[81]*dwdp[0]; - dxdotdp[90] = -p[0]*x[0]*dwdp[5]-p[0]*x[90]*dwdp[0]; - dxdotdp[91] = p[0]*x[0]*dwdp[5]+p[0]*x[90]*dwdp[0]; - dxdotdp[99] = -p[0]*x[99]*dwdp[0]; - dxdotdp[100] = p[0]*x[99]*dwdp[0]; - dxdotdp[108] = -p[0]*x[108]*dwdp[0]; - dxdotdp[109] = p[0]*x[108]*dwdp[0]; - dxdotdp[117] = -p[0]*x[117]*dwdp[0]; - dxdotdp[118] = p[0]*x[117]*dwdp[0]; - dxdotdp[126] = -p[0]*x[126]*dwdp[0]; - dxdotdp[127] = p[0]*x[126]*dwdp[0]; - dxdotdp[135] = -p[0]*x[135]*dwdp[0]; - dxdotdp[136] = p[0]*x[135]*dwdp[0]; - dxdotdp[144] = -p[0]*x[144]*dwdp[0]; - dxdotdp[145] = p[0]*x[144]*dwdp[0]; - dxdotdp[153] = -p[0]*x[153]*dwdp[0]; - dxdotdp[154] = p[0]*x[153]*dwdp[0]; - - } break; - - case 6: { - dxdotdp[0] = -k[0]*p[0]*x[0]*w[2]*dwdp[6]; - dxdotdp[1] = p[0]*x[0]*dwdp[6]; - dxdotdp[9] = -dwdp[6]*(x[0]+p[0]*x[9]); - dxdotdp[10] = dwdp[6]*(x[0]+p[0]*x[9]); - dxdotdp[18] = -p[0]*x[18]*dwdp[6]; - dxdotdp[19] = p[0]*x[18]*dwdp[6]; - dxdotdp[27] = -p[0]*x[27]*dwdp[6]; - dxdotdp[28] = p[0]*x[27]*dwdp[6]; - dxdotdp[36] = -p[0]*x[36]*dwdp[6]; - dxdotdp[37] = p[0]*x[36]*dwdp[6]; - dxdotdp[45] = -p[0]*x[45]*dwdp[6]; - dxdotdp[46] = p[0]*x[45]*dwdp[6]; - dxdotdp[54] = -p[0]*x[0]*dwdp[7]-p[0]*x[54]*dwdp[6]; - dxdotdp[55] = p[0]*x[0]*dwdp[7]+p[0]*x[54]*dwdp[6]; - dxdotdp[63] = -p[0]*x[0]*dwdp[8]-p[0]*x[63]*dwdp[6]; - dxdotdp[64] = p[0]*x[0]*dwdp[8]+p[0]*x[63]*dwdp[6]; - dxdotdp[72] = -p[0]*x[0]*dwdp[9]-p[0]*x[72]*dwdp[6]; - dxdotdp[73] = p[0]*x[0]*dwdp[9]+p[0]*x[72]*dwdp[6]; - dxdotdp[81] = -p[0]*x[0]*dwdp[10]-p[0]*x[81]*dwdp[6]; - dxdotdp[82] = p[0]*x[0]*dwdp[10]+p[0]*x[81]*dwdp[6]; - dxdotdp[90] = -p[0]*x[0]*dwdp[11]-p[0]*x[90]*dwdp[6]; - dxdotdp[91] = p[0]*x[0]*dwdp[11]+p[0]*x[90]*dwdp[6]; - dxdotdp[99] = -p[0]*x[99]*dwdp[6]; - dxdotdp[100] = p[0]*x[99]*dwdp[6]; - dxdotdp[108] = -p[0]*x[108]*dwdp[6]; - dxdotdp[109] = p[0]*x[108]*dwdp[6]; - dxdotdp[117] = -p[0]*x[117]*dwdp[6]; - dxdotdp[118] = p[0]*x[117]*dwdp[6]; - dxdotdp[126] = -p[0]*x[126]*dwdp[6]; - dxdotdp[127] = p[0]*x[126]*dwdp[6]; - dxdotdp[135] = -p[0]*x[135]*dwdp[6]; - dxdotdp[136] = p[0]*x[135]*dwdp[6]; - dxdotdp[144] = -p[0]*x[144]*dwdp[6]; - dxdotdp[145] = p[0]*x[144]*dwdp[6]; - dxdotdp[153] = -p[0]*x[153]*dwdp[6]; - dxdotdp[154] = p[0]*x[153]*dwdp[6]; - - } break; - - case 7: { - dxdotdp[0] = -k[0]*p[0]*x[0]*w[2]*dwdp[12]; - dxdotdp[1] = p[0]*x[0]*dwdp[12]; - dxdotdp[9] = -dwdp[12]*(x[0]+p[0]*x[9]); - dxdotdp[10] = dwdp[12]*(x[0]+p[0]*x[9]); - dxdotdp[18] = -p[0]*x[18]*dwdp[12]; - dxdotdp[19] = p[0]*x[18]*dwdp[12]; - dxdotdp[27] = -p[0]*x[27]*dwdp[12]; - dxdotdp[28] = p[0]*x[27]*dwdp[12]; - dxdotdp[36] = -p[0]*x[36]*dwdp[12]; - dxdotdp[37] = p[0]*x[36]*dwdp[12]; - dxdotdp[45] = -p[0]*x[45]*dwdp[12]; - dxdotdp[46] = p[0]*x[45]*dwdp[12]; - dxdotdp[54] = -p[0]*x[0]*dwdp[13]-p[0]*x[54]*dwdp[12]; - dxdotdp[55] = p[0]*x[0]*dwdp[13]+p[0]*x[54]*dwdp[12]; - dxdotdp[63] = -p[0]*x[0]*dwdp[14]-p[0]*x[63]*dwdp[12]; - dxdotdp[64] = p[0]*x[0]*dwdp[14]+p[0]*x[63]*dwdp[12]; - dxdotdp[72] = -p[0]*x[0]*dwdp[15]-p[0]*x[72]*dwdp[12]; - dxdotdp[73] = p[0]*x[0]*dwdp[15]+p[0]*x[72]*dwdp[12]; - dxdotdp[81] = -p[0]*x[0]*dwdp[16]-p[0]*x[81]*dwdp[12]; - dxdotdp[82] = p[0]*x[0]*dwdp[16]+p[0]*x[81]*dwdp[12]; - dxdotdp[90] = -p[0]*x[0]*dwdp[17]-p[0]*x[90]*dwdp[12]; - dxdotdp[91] = p[0]*x[0]*dwdp[17]+p[0]*x[90]*dwdp[12]; - dxdotdp[99] = -p[0]*x[99]*dwdp[12]; - dxdotdp[100] = p[0]*x[99]*dwdp[12]; - dxdotdp[108] = -p[0]*x[108]*dwdp[12]; - dxdotdp[109] = p[0]*x[108]*dwdp[12]; - dxdotdp[117] = -p[0]*x[117]*dwdp[12]; - dxdotdp[118] = p[0]*x[117]*dwdp[12]; - dxdotdp[126] = -p[0]*x[126]*dwdp[12]; - dxdotdp[127] = p[0]*x[126]*dwdp[12]; - dxdotdp[135] = -p[0]*x[135]*dwdp[12]; - dxdotdp[136] = p[0]*x[135]*dwdp[12]; - dxdotdp[144] = -p[0]*x[144]*dwdp[12]; - dxdotdp[145] = p[0]*x[144]*dwdp[12]; - dxdotdp[153] = -p[0]*x[153]*dwdp[12]; - dxdotdp[154] = p[0]*x[153]*dwdp[12]; - - } break; - - case 8: { - dxdotdp[0] = -k[0]*p[0]*x[0]*w[2]*dwdp[18]; - dxdotdp[1] = p[0]*x[0]*dwdp[18]; - dxdotdp[9] = -dwdp[18]*(x[0]+p[0]*x[9]); - dxdotdp[10] = dwdp[18]*(x[0]+p[0]*x[9]); - dxdotdp[18] = -p[0]*x[18]*dwdp[18]; - dxdotdp[19] = p[0]*x[18]*dwdp[18]; - dxdotdp[27] = -p[0]*x[27]*dwdp[18]; - dxdotdp[28] = p[0]*x[27]*dwdp[18]; - dxdotdp[36] = -p[0]*x[36]*dwdp[18]; - dxdotdp[37] = p[0]*x[36]*dwdp[18]; - dxdotdp[45] = -p[0]*x[45]*dwdp[18]; - dxdotdp[46] = p[0]*x[45]*dwdp[18]; - dxdotdp[54] = -p[0]*x[0]*dwdp[19]-p[0]*x[54]*dwdp[18]; - dxdotdp[55] = p[0]*x[0]*dwdp[19]+p[0]*x[54]*dwdp[18]; - dxdotdp[63] = -p[0]*x[0]*dwdp[20]-p[0]*x[63]*dwdp[18]; - dxdotdp[64] = p[0]*x[0]*dwdp[20]+p[0]*x[63]*dwdp[18]; - dxdotdp[72] = -p[0]*x[0]*dwdp[21]-p[0]*x[72]*dwdp[18]; - dxdotdp[73] = p[0]*x[0]*dwdp[21]+p[0]*x[72]*dwdp[18]; - dxdotdp[81] = -p[0]*x[0]*dwdp[22]-p[0]*x[81]*dwdp[18]; - dxdotdp[82] = p[0]*x[0]*dwdp[22]+p[0]*x[81]*dwdp[18]; - dxdotdp[90] = -p[0]*x[0]*dwdp[23]-p[0]*x[90]*dwdp[18]; - dxdotdp[91] = p[0]*x[0]*dwdp[23]+p[0]*x[90]*dwdp[18]; - dxdotdp[99] = -p[0]*x[99]*dwdp[18]; - dxdotdp[100] = p[0]*x[99]*dwdp[18]; - dxdotdp[108] = -p[0]*x[108]*dwdp[18]; - dxdotdp[109] = p[0]*x[108]*dwdp[18]; - dxdotdp[117] = -p[0]*x[117]*dwdp[18]; - dxdotdp[118] = p[0]*x[117]*dwdp[18]; - dxdotdp[126] = -p[0]*x[126]*dwdp[18]; - dxdotdp[127] = p[0]*x[126]*dwdp[18]; - dxdotdp[135] = -p[0]*x[135]*dwdp[18]; - dxdotdp[136] = p[0]*x[135]*dwdp[18]; - dxdotdp[144] = -p[0]*x[144]*dwdp[18]; - dxdotdp[145] = p[0]*x[144]*dwdp[18]; - dxdotdp[153] = -p[0]*x[153]*dwdp[18]; - dxdotdp[154] = p[0]*x[153]*dwdp[18]; - - } break; - - case 9: { - dxdotdp[0] = -k[0]*p[0]*x[0]*w[2]*dwdp[24]; - dxdotdp[1] = p[0]*x[0]*dwdp[24]; - dxdotdp[9] = -dwdp[24]*(x[0]+p[0]*x[9]); - dxdotdp[10] = dwdp[24]*(x[0]+p[0]*x[9]); - dxdotdp[18] = -p[0]*x[18]*dwdp[24]; - dxdotdp[19] = p[0]*x[18]*dwdp[24]; - dxdotdp[27] = -p[0]*x[27]*dwdp[24]; - dxdotdp[28] = p[0]*x[27]*dwdp[24]; - dxdotdp[36] = -p[0]*x[36]*dwdp[24]; - dxdotdp[37] = p[0]*x[36]*dwdp[24]; - dxdotdp[45] = -p[0]*x[45]*dwdp[24]; - dxdotdp[46] = p[0]*x[45]*dwdp[24]; - dxdotdp[54] = -p[0]*x[0]*dwdp[25]-p[0]*x[54]*dwdp[24]; - dxdotdp[55] = p[0]*x[0]*dwdp[25]+p[0]*x[54]*dwdp[24]; - dxdotdp[63] = -p[0]*x[0]*dwdp[26]-p[0]*x[63]*dwdp[24]; - dxdotdp[64] = p[0]*x[0]*dwdp[26]+p[0]*x[63]*dwdp[24]; - dxdotdp[72] = -p[0]*x[0]*dwdp[27]-p[0]*x[72]*dwdp[24]; - dxdotdp[73] = p[0]*x[0]*dwdp[27]+p[0]*x[72]*dwdp[24]; - dxdotdp[81] = -p[0]*x[0]*dwdp[28]-p[0]*x[81]*dwdp[24]; - dxdotdp[82] = p[0]*x[0]*dwdp[28]+p[0]*x[81]*dwdp[24]; - dxdotdp[90] = -p[0]*x[0]*dwdp[29]-p[0]*x[90]*dwdp[24]; - dxdotdp[91] = p[0]*x[0]*dwdp[29]+p[0]*x[90]*dwdp[24]; - dxdotdp[99] = -p[0]*x[99]*dwdp[24]; - dxdotdp[100] = p[0]*x[99]*dwdp[24]; - dxdotdp[108] = -p[0]*x[108]*dwdp[24]; - dxdotdp[109] = p[0]*x[108]*dwdp[24]; - dxdotdp[117] = -p[0]*x[117]*dwdp[24]; - dxdotdp[118] = p[0]*x[117]*dwdp[24]; - dxdotdp[126] = -p[0]*x[126]*dwdp[24]; - dxdotdp[127] = p[0]*x[126]*dwdp[24]; - dxdotdp[135] = -p[0]*x[135]*dwdp[24]; - dxdotdp[136] = p[0]*x[135]*dwdp[24]; - dxdotdp[144] = -p[0]*x[144]*dwdp[24]; - dxdotdp[145] = p[0]*x[144]*dwdp[24]; - dxdotdp[153] = -p[0]*x[153]*dwdp[24]; - dxdotdp[154] = p[0]*x[153]*dwdp[24]; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dydp.cpp b/models/model_jakstat_adjoint_o2/dydp.cpp deleted file mode 100644 index 678e6c0201..0000000000 --- a/models/model_jakstat_adjoint_o2/dydp.cpp +++ /dev/null @@ -1,165 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dydp_model_jakstat_adjoint_o2(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 4: { - dydp[0] = -1.0/(p[4]*p[4])*p[13]*(x[1]+x[2]*2.0); - dydp[1] = -1.0/(p[4]*p[4])*p[12]*(x[0]+x[1]+x[2]*2.0); - dydp[3] = -1.0/(p[4]*p[4])*p[13]*x[10]-1.0/(p[4]*p[4])*p[13]*x[11]*2.0; - dydp[4] = -1.0/(p[4]*p[4])*p[12]*x[9]-1.0/(p[4]*p[4])*p[12]*x[10]-1.0/(p[4]*p[4])*p[12]*x[11]*2.0; - dydp[6] = -1.0/(p[4]*p[4])*p[13]*x[19]-1.0/(p[4]*p[4])*p[13]*x[20]*2.0; - dydp[7] = -1.0/(p[4]*p[4])*p[12]*x[18]-1.0/(p[4]*p[4])*p[12]*x[19]-1.0/(p[4]*p[4])*p[12]*x[20]*2.0; - dydp[9] = -1.0/(p[4]*p[4])*p[13]*x[28]-1.0/(p[4]*p[4])*p[13]*x[29]*2.0; - dydp[10] = -1.0/(p[4]*p[4])*p[12]*x[27]-1.0/(p[4]*p[4])*p[12]*x[28]-1.0/(p[4]*p[4])*p[12]*x[29]*2.0; - dydp[12] = -1.0/(p[4]*p[4])*p[13]*x[37]-1.0/(p[4]*p[4])*p[13]*x[38]*2.0; - dydp[13] = -1.0/(p[4]*p[4])*p[12]*x[36]-1.0/(p[4]*p[4])*p[12]*x[37]-1.0/(p[4]*p[4])*p[12]*x[38]*2.0; - dydp[15] = -1.0/(p[4]*p[4])*p[13]*x[46]-1.0/(p[4]*p[4])*p[13]*x[47]*2.0+1.0/(p[4]*p[4]*p[4])*p[13]*(x[1]+x[2]*2.0)*2.0; - dydp[16] = -1.0/(p[4]*p[4])*p[12]*x[45]-1.0/(p[4]*p[4])*p[12]*x[46]-1.0/(p[4]*p[4])*p[12]*x[47]*2.0+1.0/(p[4]*p[4]*p[4])*p[12]*(x[0]+x[1]+x[2]*2.0)*2.0; - dydp[18] = -1.0/(p[4]*p[4])*p[13]*x[55]-1.0/(p[4]*p[4])*p[13]*x[56]*2.0; - dydp[19] = -1.0/(p[4]*p[4])*p[12]*x[54]-1.0/(p[4]*p[4])*p[12]*x[55]-1.0/(p[4]*p[4])*p[12]*x[56]*2.0; - dydp[21] = -1.0/(p[4]*p[4])*p[13]*x[64]-1.0/(p[4]*p[4])*p[13]*x[65]*2.0; - dydp[22] = -1.0/(p[4]*p[4])*p[12]*x[63]-1.0/(p[4]*p[4])*p[12]*x[64]-1.0/(p[4]*p[4])*p[12]*x[65]*2.0; - dydp[24] = -1.0/(p[4]*p[4])*p[13]*x[73]-1.0/(p[4]*p[4])*p[13]*x[74]*2.0; - dydp[25] = -1.0/(p[4]*p[4])*p[12]*x[72]-1.0/(p[4]*p[4])*p[12]*x[73]-1.0/(p[4]*p[4])*p[12]*x[74]*2.0; - dydp[27] = -1.0/(p[4]*p[4])*p[13]*x[82]-1.0/(p[4]*p[4])*p[13]*x[83]*2.0; - dydp[28] = -1.0/(p[4]*p[4])*p[12]*x[81]-1.0/(p[4]*p[4])*p[12]*x[82]-1.0/(p[4]*p[4])*p[12]*x[83]*2.0; - dydp[30] = -1.0/(p[4]*p[4])*p[13]*x[91]-1.0/(p[4]*p[4])*p[13]*x[92]*2.0; - dydp[31] = -1.0/(p[4]*p[4])*p[12]*x[90]-1.0/(p[4]*p[4])*p[12]*x[91]-1.0/(p[4]*p[4])*p[12]*x[92]*2.0; - dydp[33] = -1.0/(p[4]*p[4])*p[13]*x[100]-1.0/(p[4]*p[4])*p[13]*x[101]*2.0; - dydp[34] = -1.0/(p[4]*p[4])*p[12]*x[99]-1.0/(p[4]*p[4])*p[12]*x[100]-1.0/(p[4]*p[4])*p[12]*x[101]*2.0; - dydp[36] = -1.0/(p[4]*p[4])*p[13]*x[109]-1.0/(p[4]*p[4])*p[13]*x[110]*2.0; - dydp[37] = -1.0/(p[4]*p[4])*p[12]*x[108]-1.0/(p[4]*p[4])*p[12]*x[109]-1.0/(p[4]*p[4])*p[12]*x[110]*2.0; - dydp[39] = -1.0/(p[4]*p[4])*p[13]*x[118]-1.0/(p[4]*p[4])*p[13]*x[119]*2.0; - dydp[40] = -1.0/(p[4]*p[4])*(x[0]+x[1]+x[2]*2.0)-1.0/(p[4]*p[4])*p[12]*x[117]-1.0/(p[4]*p[4])*p[12]*x[118]-1.0/(p[4]*p[4])*p[12]*x[119]*2.0; - dydp[42] = -1.0/(p[4]*p[4])*(x[1]+x[2]*2.0)-1.0/(p[4]*p[4])*p[13]*x[127]-1.0/(p[4]*p[4])*p[13]*x[128]*2.0; - dydp[43] = -1.0/(p[4]*p[4])*p[12]*x[126]-1.0/(p[4]*p[4])*p[12]*x[127]-1.0/(p[4]*p[4])*p[12]*x[128]*2.0; - dydp[45] = -1.0/(p[4]*p[4])*p[13]*x[136]-1.0/(p[4]*p[4])*p[13]*x[137]*2.0; - dydp[46] = -1.0/(p[4]*p[4])*p[12]*x[135]-1.0/(p[4]*p[4])*p[12]*x[136]-1.0/(p[4]*p[4])*p[12]*x[137]*2.0; - dydp[48] = -1.0/(p[4]*p[4])*p[13]*x[145]-1.0/(p[4]*p[4])*p[13]*x[146]*2.0; - dydp[49] = -1.0/(p[4]*p[4])*p[12]*x[144]-1.0/(p[4]*p[4])*p[12]*x[145]-1.0/(p[4]*p[4])*p[12]*x[146]*2.0; - dydp[51] = -1.0/(p[4]*p[4])*p[13]*x[154]-1.0/(p[4]*p[4])*p[13]*x[155]*2.0; - dydp[52] = -1.0/(p[4]*p[4])*p[12]*x[153]-1.0/(p[4]*p[4])*p[12]*x[154]-1.0/(p[4]*p[4])*p[12]*x[155]*2.0; - - } break; - - case 5: { - dydp[2] = amici::Dspline_pos(4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[20] = amici::DDspline_pos(4,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[23] = amici::DDspline_pos(6,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[26] = amici::DDspline_pos(8,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[29] = amici::DDspline_pos(10,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[32] = amici::DDspline_pos(12,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 6: { - dydp[2] = amici::Dspline_pos(6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[20] = amici::DDspline_pos(6,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[23] = amici::DDspline_pos(6,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[26] = amici::DDspline_pos(8,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[29] = amici::DDspline_pos(10,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[32] = amici::DDspline_pos(12,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 7: { - dydp[2] = amici::Dspline_pos(8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[20] = amici::DDspline_pos(8,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[23] = amici::DDspline_pos(8,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[26] = amici::DDspline_pos(8,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[29] = amici::DDspline_pos(10,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[32] = amici::DDspline_pos(12,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 8: { - dydp[2] = amici::Dspline_pos(10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[20] = amici::DDspline_pos(10,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[23] = amici::DDspline_pos(10,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[26] = amici::DDspline_pos(10,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[29] = amici::DDspline_pos(10,10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[32] = amici::DDspline_pos(12,10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 9: { - dydp[2] = amici::Dspline_pos(12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[20] = amici::DDspline_pos(12,4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[23] = amici::DDspline_pos(12,6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[26] = amici::DDspline_pos(12,8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[29] = amici::DDspline_pos(12,10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - dydp[32] = amici::DDspline_pos(12,12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - - } break; - - case 10: { - dydp[1] = 1.0; - - } break; - - case 11: { - dydp[0] = 1.0; - - } break; - - case 12: { - dydp[1] = (x[0]+x[1]+x[2]*2.0)/p[4]; - dydp[4] = x[9]/p[4]+x[10]/p[4]+(x[11]*2.0)/p[4]; - dydp[7] = x[18]/p[4]+x[19]/p[4]+(x[20]*2.0)/p[4]; - dydp[10] = x[27]/p[4]+x[28]/p[4]+(x[29]*2.0)/p[4]; - dydp[13] = x[36]/p[4]+x[37]/p[4]+(x[38]*2.0)/p[4]; - dydp[16] = -1.0/(p[4]*p[4])*(x[0]+x[1]+x[2]*2.0)+x[45]/p[4]+x[46]/p[4]+(x[47]*2.0)/p[4]; - dydp[19] = x[54]/p[4]+x[55]/p[4]+(x[56]*2.0)/p[4]; - dydp[22] = x[63]/p[4]+x[64]/p[4]+(x[65]*2.0)/p[4]; - dydp[25] = x[72]/p[4]+x[73]/p[4]+(x[74]*2.0)/p[4]; - dydp[28] = x[81]/p[4]+x[82]/p[4]+(x[83]*2.0)/p[4]; - dydp[31] = x[90]/p[4]+x[91]/p[4]+(x[92]*2.0)/p[4]; - dydp[34] = x[99]/p[4]+x[100]/p[4]+(x[101]*2.0)/p[4]; - dydp[37] = x[108]/p[4]+x[109]/p[4]+(x[110]*2.0)/p[4]; - dydp[40] = x[117]/p[4]+x[118]/p[4]+(x[119]*2.0)/p[4]; - dydp[43] = x[126]/p[4]+x[127]/p[4]+(x[128]*2.0)/p[4]; - dydp[46] = x[135]/p[4]+x[136]/p[4]+(x[137]*2.0)/p[4]; - dydp[49] = x[144]/p[4]+x[145]/p[4]+(x[146]*2.0)/p[4]; - dydp[52] = x[153]/p[4]+x[154]/p[4]+(x[155]*2.0)/p[4]; - - } break; - - case 13: { - dydp[0] = (x[1]+x[2]*2.0)/p[4]; - dydp[3] = x[10]/p[4]+(x[11]*2.0)/p[4]; - dydp[6] = x[19]/p[4]+(x[20]*2.0)/p[4]; - dydp[9] = x[28]/p[4]+(x[29]*2.0)/p[4]; - dydp[12] = x[37]/p[4]+(x[38]*2.0)/p[4]; - dydp[15] = x[46]/p[4]+(x[47]*2.0)/p[4]-1.0/(p[4]*p[4])*(x[1]+x[2]*2.0); - dydp[18] = x[55]/p[4]+(x[56]*2.0)/p[4]; - dydp[21] = x[64]/p[4]+(x[65]*2.0)/p[4]; - dydp[24] = x[73]/p[4]+(x[74]*2.0)/p[4]; - dydp[27] = x[82]/p[4]+(x[83]*2.0)/p[4]; - dydp[30] = x[91]/p[4]+(x[92]*2.0)/p[4]; - dydp[33] = x[100]/p[4]+(x[101]*2.0)/p[4]; - dydp[36] = x[109]/p[4]+(x[110]*2.0)/p[4]; - dydp[39] = x[118]/p[4]+(x[119]*2.0)/p[4]; - dydp[42] = x[127]/p[4]+(x[128]*2.0)/p[4]; - dydp[45] = x[136]/p[4]+(x[137]*2.0)/p[4]; - dydp[48] = x[145]/p[4]+(x[146]*2.0)/p[4]; - dydp[51] = x[154]/p[4]+(x[155]*2.0)/p[4]; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/dydx.cpp b/models/model_jakstat_adjoint_o2/dydx.cpp deleted file mode 100644 index ffd7796971..0000000000 --- a/models/model_jakstat_adjoint_o2/dydx.cpp +++ /dev/null @@ -1,119 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void dydx_model_jakstat_adjoint_o2(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+1*54] = p[13]/p[4]; - dydx[0+2*54] = (p[13]*2.0)/p[4]; - dydx[1+0*54] = p[12]/p[4]; - dydx[1+1*54] = p[12]/p[4]; - dydx[1+2*54] = (p[12]*2.0)/p[4]; - dydx[3+10*54] = p[13]/p[4]; - dydx[3+11*54] = (p[13]*2.0)/p[4]; - dydx[4+9*54] = p[12]/p[4]; - dydx[4+10*54] = p[12]/p[4]; - dydx[4+11*54] = (p[12]*2.0)/p[4]; - dydx[6+19*54] = p[13]/p[4]; - dydx[6+20*54] = (p[13]*2.0)/p[4]; - dydx[7+18*54] = p[12]/p[4]; - dydx[7+19*54] = p[12]/p[4]; - dydx[7+20*54] = (p[12]*2.0)/p[4]; - dydx[9+28*54] = p[13]/p[4]; - dydx[9+29*54] = (p[13]*2.0)/p[4]; - dydx[10+27*54] = p[12]/p[4]; - dydx[10+28*54] = p[12]/p[4]; - dydx[10+29*54] = (p[12]*2.0)/p[4]; - dydx[12+37*54] = p[13]/p[4]; - dydx[12+38*54] = (p[13]*2.0)/p[4]; - dydx[13+36*54] = p[12]/p[4]; - dydx[13+37*54] = p[12]/p[4]; - dydx[13+38*54] = (p[12]*2.0)/p[4]; - dydx[15+1*54] = -1.0/(p[4]*p[4])*p[13]; - dydx[15+2*54] = 1.0/(p[4]*p[4])*p[13]*-2.0; - dydx[15+46*54] = p[13]/p[4]; - dydx[15+47*54] = (p[13]*2.0)/p[4]; - dydx[16+0*54] = -1.0/(p[4]*p[4])*p[12]; - dydx[16+1*54] = -1.0/(p[4]*p[4])*p[12]; - dydx[16+2*54] = 1.0/(p[4]*p[4])*p[12]*-2.0; - dydx[16+45*54] = p[12]/p[4]; - dydx[16+46*54] = p[12]/p[4]; - dydx[16+47*54] = (p[12]*2.0)/p[4]; - dydx[18+55*54] = p[13]/p[4]; - dydx[18+56*54] = (p[13]*2.0)/p[4]; - dydx[19+54*54] = p[12]/p[4]; - dydx[19+55*54] = p[12]/p[4]; - dydx[19+56*54] = (p[12]*2.0)/p[4]; - dydx[21+64*54] = p[13]/p[4]; - dydx[21+65*54] = (p[13]*2.0)/p[4]; - dydx[22+63*54] = p[12]/p[4]; - dydx[22+64*54] = p[12]/p[4]; - dydx[22+65*54] = (p[12]*2.0)/p[4]; - dydx[24+73*54] = p[13]/p[4]; - dydx[24+74*54] = (p[13]*2.0)/p[4]; - dydx[25+72*54] = p[12]/p[4]; - dydx[25+73*54] = p[12]/p[4]; - dydx[25+74*54] = (p[12]*2.0)/p[4]; - dydx[27+82*54] = p[13]/p[4]; - dydx[27+83*54] = (p[13]*2.0)/p[4]; - dydx[28+81*54] = p[12]/p[4]; - dydx[28+82*54] = p[12]/p[4]; - dydx[28+83*54] = (p[12]*2.0)/p[4]; - dydx[30+91*54] = p[13]/p[4]; - dydx[30+92*54] = (p[13]*2.0)/p[4]; - dydx[31+90*54] = p[12]/p[4]; - dydx[31+91*54] = p[12]/p[4]; - dydx[31+92*54] = (p[12]*2.0)/p[4]; - dydx[33+100*54] = p[13]/p[4]; - dydx[33+101*54] = (p[13]*2.0)/p[4]; - dydx[34+99*54] = p[12]/p[4]; - dydx[34+100*54] = p[12]/p[4]; - dydx[34+101*54] = (p[12]*2.0)/p[4]; - dydx[36+109*54] = p[13]/p[4]; - dydx[36+110*54] = (p[13]*2.0)/p[4]; - dydx[37+108*54] = p[12]/p[4]; - dydx[37+109*54] = p[12]/p[4]; - dydx[37+110*54] = (p[12]*2.0)/p[4]; - dydx[39+118*54] = p[13]/p[4]; - dydx[39+119*54] = (p[13]*2.0)/p[4]; - dydx[40+0*54] = 1.0/p[4]; - dydx[40+1*54] = 1.0/p[4]; - dydx[40+2*54] = 2.0/p[4]; - dydx[40+117*54] = p[12]/p[4]; - dydx[40+118*54] = p[12]/p[4]; - dydx[40+119*54] = (p[12]*2.0)/p[4]; - dydx[42+1*54] = 1.0/p[4]; - dydx[42+2*54] = 2.0/p[4]; - dydx[42+127*54] = p[13]/p[4]; - dydx[42+128*54] = (p[13]*2.0)/p[4]; - dydx[43+126*54] = p[12]/p[4]; - dydx[43+127*54] = p[12]/p[4]; - dydx[43+128*54] = (p[12]*2.0)/p[4]; - dydx[45+136*54] = p[13]/p[4]; - dydx[45+137*54] = (p[13]*2.0)/p[4]; - dydx[46+135*54] = p[12]/p[4]; - dydx[46+136*54] = p[12]/p[4]; - dydx[46+137*54] = (p[12]*2.0)/p[4]; - dydx[48+145*54] = p[13]/p[4]; - dydx[48+146*54] = (p[13]*2.0)/p[4]; - dydx[49+144*54] = p[12]/p[4]; - dydx[49+145*54] = p[12]/p[4]; - dydx[49+146*54] = (p[12]*2.0)/p[4]; - dydx[51+154*54] = p[13]/p[4]; - dydx[51+155*54] = (p[13]*2.0)/p[4]; - dydx[52+153*54] = p[12]/p[4]; - dydx[52+154*54] = p[12]/p[4]; - dydx[52+155*54] = (p[12]*2.0)/p[4]; -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/main.cpp b/models/model_jakstat_adjoint_o2/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_jakstat_adjoint_o2/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h b/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h deleted file mode 100644 index d7b34417b6..0000000000 --- a/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h +++ /dev/null @@ -1,216 +0,0 @@ -#ifndef _amici_model_jakstat_adjoint_o2_h -#define _amici_model_jakstat_adjoint_o2_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_jakstat_adjoint_o2{ - -extern void JSparse_model_jakstat_adjoint_o2(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jy_model_jakstat_adjoint_o2(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydsigma_model_jakstat_adjoint_o2(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_jakstat_adjoint_o2(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dsigmaydp_model_jakstat_adjoint_o2(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip); -extern void dwdp_model_jakstat_adjoint_o2(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static); -extern void dwdx_model_jakstat_adjoint_o2(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static); -extern void dxdotdp_model_jakstat_adjoint_o2(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydp_model_jakstat_adjoint_o2(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_jakstat_adjoint_o2(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void sigmay_model_jakstat_adjoint_o2(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void sx0_model_jakstat_adjoint_o2(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip); -extern void w_model_jakstat_adjoint_o2(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static); -extern void x0_model_jakstat_adjoint_o2(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_jakstat_adjoint_o2(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_jakstat_adjoint_o2(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); - -class Model_model_jakstat_adjoint_o2 : public amici::Model_ODE { -public: - Model_model_jakstat_adjoint_o2() - : amici::Model_ODE( - amici::ModelDimensions( - 162, - 9, - 162, - 9, - 0, - 17, - 2, - 54, - 3, - 0, - 0, - 0, - 0, - 0, - 18, - 10, - 2, - 30, - 0, - 0, - {}, - 0, - 0, - 0, - 384, - 8, - 154 - ), - amici::SimulationParameters( - std::vector(2, 1.0), - std::vector(17, 1.0) - ), - amici::SecondOrderMode::full, - std::vector{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - std::vector{}) - {}; - - amici::Model* clone() const override { return new Model_model_jakstat_adjoint_o2(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_jakstat_adjoint_o2(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_jakstat_adjoint_o2(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_jakstat_adjoint_o2(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_jakstat_adjoint_o2(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - dsigmaydp_model_jakstat_adjoint_o2(dsigmaydp, t, p, k, y, ip); - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - dwdp_model_jakstat_adjoint_o2(dwdp, t, x, p, k, h, w, tcl, stcl, spl, sspl, include_static); - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - dwdx_model_jakstat_adjoint_o2(dwdx, t, x, p, k, h, w, tcl, spl, include_static); - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_jakstat_adjoint_o2(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dydp_model_jakstat_adjoint_o2(dydp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydx(double *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_o2(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_jakstat_adjoint_o2(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - sx0_model_jakstat_adjoint_o2(sx0, t, x0, p, k, ip); - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - w_model_jakstat_adjoint_o2(w, t, x, p, k, h, tcl, spl, include_static); - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_jakstat_adjoint_o2(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_jakstat_adjoint_o2(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_jakstat_adjoint_o2(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - -}; - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - -#endif /* _amici_model_jakstat_adjoint_o2_h */ diff --git a/models/model_jakstat_adjoint_o2/sigmay.cpp b/models/model_jakstat_adjoint_o2/sigmay.cpp deleted file mode 100644 index 6b162c6f03..0000000000 --- a/models/model_jakstat_adjoint_o2/sigmay.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void sigmay_model_jakstat_adjoint_o2(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = p[14]; - sigmay[1] = p[15]; - sigmay[2] = p[16]; - sigmay[17] = 1.0; - sigmay[35] = 1.0; - sigmay[53] = 1.0; -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/swig/CMakeLists.txt b/models/model_jakstat_adjoint_o2/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_jakstat_adjoint_o2/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_jakstat_adjoint_o2/swig/model_jakstat_adjoint_o2.i b/models/model_jakstat_adjoint_o2/swig/model_jakstat_adjoint_o2.i deleted file mode 100644 index 50591d090c..0000000000 --- a/models/model_jakstat_adjoint_o2/swig/model_jakstat_adjoint_o2.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_jakstat_adjoint_o2 -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_jakstat_adjoint_o2/sx0.cpp b/models/model_jakstat_adjoint_o2/sx0.cpp deleted file mode 100644 index bfc0aa2572..0000000000 --- a/models/model_jakstat_adjoint_o2/sx0.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void sx0_model_jakstat_adjoint_o2(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) { -switch (ip) { - case 4: { - sx0[0] = 1.0; - - } break; - -} -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/w.cpp b/models/model_jakstat_adjoint_o2/w.cpp deleted file mode 100644 index 827202e139..0000000000 --- a/models/model_jakstat_adjoint_o2/w.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void w_model_jakstat_adjoint_o2(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) { - w[0] = amici::spline_pos(t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - w[1] = x[1]*x[1]; - w[2] = 1.0/k[0]; - w[3] = 1.0/k[1]; - w[4] = x[3]*2.0; - w[5] = amici::Dspline_pos(4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - w[6] = amici::Dspline_pos(6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - w[7] = amici::Dspline_pos(8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - w[8] = amici::Dspline_pos(10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - w[9] = amici::Dspline_pos(12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/wrapfunctions.cpp b/models/model_jakstat_adjoint_o2/wrapfunctions.cpp deleted file mode 100644 index 470a21b4b5..0000000000 --- a/models/model_jakstat_adjoint_o2/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_jakstat_adjoint_o2::Model_model_jakstat_adjoint_o2()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/wrapfunctions.h b/models/model_jakstat_adjoint_o2/wrapfunctions.h deleted file mode 100644 index 0bb7f64735..0000000000 --- a/models/model_jakstat_adjoint_o2/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_jakstat_adjoint_o2.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_jakstat_adjoint_o2/x0.cpp b/models/model_jakstat_adjoint_o2/x0.cpp deleted file mode 100644 index 4ad7ee8cf9..0000000000 --- a/models/model_jakstat_adjoint_o2/x0.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void x0_model_jakstat_adjoint_o2(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = p[4]; - x0[45] = 1.0; -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/xdot.cpp b/models/model_jakstat_adjoint_o2/xdot.cpp deleted file mode 100644 index 50baba5d8b..0000000000 --- a/models/model_jakstat_adjoint_o2/xdot.cpp +++ /dev/null @@ -1,181 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void xdot_model_jakstat_adjoint_o2(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = w[2]*(k[1]*p[3]*x[8]-k[0]*p[0]*w[0]*x[0]); - xdot[1] = p[1]*w[1]*-2.0+p[0]*w[0]*x[0]; - xdot[2] = p[1]*w[1]-p[2]*x[2]; - xdot[3] = w[3]*(k[0]*p[2]*x[2]-k[1]*p[3]*x[3]); - xdot[4] = p[3]*(w[4]-x[4]); - xdot[5] = p[3]*(x[4]-x[5]); - xdot[6] = p[3]*(x[5]-x[6]); - xdot[7] = p[3]*(x[6]-x[7]); - xdot[8] = p[3]*(x[7]-x[8]); - xdot[9] = -w[0]*x[0]-p[0]*w[0]*x[9]+k[1]*p[3]*w[2]*x[17]; - xdot[10] = w[0]*x[0]+p[0]*w[0]*x[9]-p[1]*x[1]*x[10]*4.0; - xdot[11] = -p[2]*x[11]+p[1]*x[1]*x[10]*2.0; - xdot[12] = -p[3]*x[12]+k[0]*p[2]*w[3]*x[11]; - xdot[13] = p[3]*x[12]*2.0-p[3]*x[13]; - xdot[14] = p[3]*x[13]-p[3]*x[14]; - xdot[15] = p[3]*x[14]-p[3]*x[15]; - xdot[16] = p[3]*x[15]-p[3]*x[16]; - xdot[17] = p[3]*x[16]-p[3]*x[17]; - xdot[18] = -p[0]*w[0]*x[18]+k[1]*p[3]*w[2]*x[26]; - xdot[19] = w[1]*-2.0+p[0]*w[0]*x[18]-p[1]*x[1]*x[19]*4.0; - xdot[20] = w[1]-p[2]*x[20]+p[1]*x[1]*x[19]*2.0; - xdot[21] = -p[3]*x[21]+k[0]*p[2]*w[3]*x[20]; - xdot[22] = p[3]*x[21]*2.0-p[3]*x[22]; - xdot[23] = p[3]*x[22]-p[3]*x[23]; - xdot[24] = p[3]*x[23]-p[3]*x[24]; - xdot[25] = p[3]*x[24]-p[3]*x[25]; - xdot[26] = p[3]*x[25]-p[3]*x[26]; - xdot[27] = -p[0]*w[0]*x[27]+k[1]*p[3]*w[2]*x[35]; - xdot[28] = p[0]*w[0]*x[27]-p[1]*x[1]*x[28]*4.0; - xdot[29] = -x[2]-p[2]*x[29]+p[1]*x[1]*x[28]*2.0; - xdot[30] = -p[3]*x[30]+k[0]*w[3]*x[2]+k[0]*p[2]*w[3]*x[29]; - xdot[31] = p[3]*x[30]*2.0-p[3]*x[31]; - xdot[32] = p[3]*x[31]-p[3]*x[32]; - xdot[33] = p[3]*x[32]-p[3]*x[33]; - xdot[34] = p[3]*x[33]-p[3]*x[34]; - xdot[35] = p[3]*x[34]-p[3]*x[35]; - xdot[36] = k[1]*w[2]*x[8]-p[0]*w[0]*x[36]+k[1]*p[3]*w[2]*x[44]; - xdot[37] = p[0]*w[0]*x[36]-p[1]*x[1]*x[37]*4.0; - xdot[38] = -p[2]*x[38]+p[1]*x[1]*x[37]*2.0; - xdot[39] = -x[3]-p[3]*x[39]+k[0]*p[2]*w[3]*x[38]; - xdot[40] = w[4]-x[4]+p[3]*x[39]*2.0-p[3]*x[40]; - xdot[41] = x[4]-x[5]+p[3]*x[40]-p[3]*x[41]; - xdot[42] = x[5]-x[6]+p[3]*x[41]-p[3]*x[42]; - xdot[43] = x[6]-x[7]+p[3]*x[42]-p[3]*x[43]; - xdot[44] = x[7]-x[8]+p[3]*x[43]-p[3]*x[44]; - xdot[45] = -p[0]*w[0]*x[45]+k[1]*p[3]*w[2]*x[53]; - xdot[46] = p[0]*w[0]*x[45]-p[1]*x[1]*x[46]*4.0; - xdot[47] = -p[2]*x[47]+p[1]*x[1]*x[46]*2.0; - xdot[48] = -p[3]*x[48]+k[0]*p[2]*w[3]*x[47]; - xdot[49] = p[3]*x[48]*2.0-p[3]*x[49]; - xdot[50] = p[3]*x[49]-p[3]*x[50]; - xdot[51] = p[3]*x[50]-p[3]*x[51]; - xdot[52] = p[3]*x[51]-p[3]*x[52]; - xdot[53] = p[3]*x[52]-p[3]*x[53]; - xdot[54] = -p[0]*x[0]*w[5]-p[0]*w[0]*x[54]+k[1]*p[3]*w[2]*x[62]; - xdot[55] = p[0]*x[0]*w[5]+p[0]*w[0]*x[54]-p[1]*x[1]*x[55]*4.0; - xdot[56] = -p[2]*x[56]+p[1]*x[1]*x[55]*2.0; - xdot[57] = -p[3]*x[57]+k[0]*p[2]*w[3]*x[56]; - xdot[58] = p[3]*x[57]*2.0-p[3]*x[58]; - xdot[59] = p[3]*x[58]-p[3]*x[59]; - xdot[60] = p[3]*x[59]-p[3]*x[60]; - xdot[61] = p[3]*x[60]-p[3]*x[61]; - xdot[62] = p[3]*x[61]-p[3]*x[62]; - xdot[63] = -p[0]*x[0]*w[6]-p[0]*w[0]*x[63]+k[1]*p[3]*w[2]*x[71]; - xdot[64] = p[0]*x[0]*w[6]+p[0]*w[0]*x[63]-p[1]*x[1]*x[64]*4.0; - xdot[65] = -p[2]*x[65]+p[1]*x[1]*x[64]*2.0; - xdot[66] = -p[3]*x[66]+k[0]*p[2]*w[3]*x[65]; - xdot[67] = p[3]*x[66]*2.0-p[3]*x[67]; - xdot[68] = p[3]*x[67]-p[3]*x[68]; - xdot[69] = p[3]*x[68]-p[3]*x[69]; - xdot[70] = p[3]*x[69]-p[3]*x[70]; - xdot[71] = p[3]*x[70]-p[3]*x[71]; - xdot[72] = -p[0]*x[0]*w[7]-p[0]*w[0]*x[72]+k[1]*p[3]*w[2]*x[80]; - xdot[73] = p[0]*x[0]*w[7]+p[0]*w[0]*x[72]-p[1]*x[1]*x[73]*4.0; - xdot[74] = -p[2]*x[74]+p[1]*x[1]*x[73]*2.0; - xdot[75] = -p[3]*x[75]+k[0]*p[2]*w[3]*x[74]; - xdot[76] = p[3]*x[75]*2.0-p[3]*x[76]; - xdot[77] = p[3]*x[76]-p[3]*x[77]; - xdot[78] = p[3]*x[77]-p[3]*x[78]; - xdot[79] = p[3]*x[78]-p[3]*x[79]; - xdot[80] = p[3]*x[79]-p[3]*x[80]; - xdot[81] = -p[0]*x[0]*w[8]-p[0]*w[0]*x[81]+k[1]*p[3]*w[2]*x[89]; - xdot[82] = p[0]*x[0]*w[8]+p[0]*w[0]*x[81]-p[1]*x[1]*x[82]*4.0; - xdot[83] = -p[2]*x[83]+p[1]*x[1]*x[82]*2.0; - xdot[84] = -p[3]*x[84]+k[0]*p[2]*w[3]*x[83]; - xdot[85] = p[3]*x[84]*2.0-p[3]*x[85]; - xdot[86] = p[3]*x[85]-p[3]*x[86]; - xdot[87] = p[3]*x[86]-p[3]*x[87]; - xdot[88] = p[3]*x[87]-p[3]*x[88]; - xdot[89] = p[3]*x[88]-p[3]*x[89]; - xdot[90] = -p[0]*x[0]*w[9]-p[0]*w[0]*x[90]+k[1]*p[3]*w[2]*x[98]; - xdot[91] = p[0]*x[0]*w[9]+p[0]*w[0]*x[90]-p[1]*x[1]*x[91]*4.0; - xdot[92] = -p[2]*x[92]+p[1]*x[1]*x[91]*2.0; - xdot[93] = -p[3]*x[93]+k[0]*p[2]*w[3]*x[92]; - xdot[94] = p[3]*x[93]*2.0-p[3]*x[94]; - xdot[95] = p[3]*x[94]-p[3]*x[95]; - xdot[96] = p[3]*x[95]-p[3]*x[96]; - xdot[97] = p[3]*x[96]-p[3]*x[97]; - xdot[98] = p[3]*x[97]-p[3]*x[98]; - xdot[99] = -p[0]*w[0]*x[99]+k[1]*p[3]*w[2]*x[107]; - xdot[100] = p[0]*w[0]*x[99]-p[1]*x[1]*x[100]*4.0; - xdot[101] = -p[2]*x[101]+p[1]*x[1]*x[100]*2.0; - xdot[102] = -p[3]*x[102]+k[0]*p[2]*w[3]*x[101]; - xdot[103] = p[3]*x[102]*2.0-p[3]*x[103]; - xdot[104] = p[3]*x[103]-p[3]*x[104]; - xdot[105] = p[3]*x[104]-p[3]*x[105]; - xdot[106] = p[3]*x[105]-p[3]*x[106]; - xdot[107] = p[3]*x[106]-p[3]*x[107]; - xdot[108] = -p[0]*w[0]*x[108]+k[1]*p[3]*w[2]*x[116]; - xdot[109] = p[0]*w[0]*x[108]-p[1]*x[1]*x[109]*4.0; - xdot[110] = -p[2]*x[110]+p[1]*x[1]*x[109]*2.0; - xdot[111] = -p[3]*x[111]+k[0]*p[2]*w[3]*x[110]; - xdot[112] = p[3]*x[111]*2.0-p[3]*x[112]; - xdot[113] = p[3]*x[112]-p[3]*x[113]; - xdot[114] = p[3]*x[113]-p[3]*x[114]; - xdot[115] = p[3]*x[114]-p[3]*x[115]; - xdot[116] = p[3]*x[115]-p[3]*x[116]; - xdot[117] = -p[0]*w[0]*x[117]+k[1]*p[3]*w[2]*x[125]; - xdot[118] = p[0]*w[0]*x[117]-p[1]*x[1]*x[118]*4.0; - xdot[119] = -p[2]*x[119]+p[1]*x[1]*x[118]*2.0; - xdot[120] = -p[3]*x[120]+k[0]*p[2]*w[3]*x[119]; - xdot[121] = p[3]*x[120]*2.0-p[3]*x[121]; - xdot[122] = p[3]*x[121]-p[3]*x[122]; - xdot[123] = p[3]*x[122]-p[3]*x[123]; - xdot[124] = p[3]*x[123]-p[3]*x[124]; - xdot[125] = p[3]*x[124]-p[3]*x[125]; - xdot[126] = -p[0]*w[0]*x[126]+k[1]*p[3]*w[2]*x[134]; - xdot[127] = p[0]*w[0]*x[126]-p[1]*x[1]*x[127]*4.0; - xdot[128] = -p[2]*x[128]+p[1]*x[1]*x[127]*2.0; - xdot[129] = -p[3]*x[129]+k[0]*p[2]*w[3]*x[128]; - xdot[130] = p[3]*x[129]*2.0-p[3]*x[130]; - xdot[131] = p[3]*x[130]-p[3]*x[131]; - xdot[132] = p[3]*x[131]-p[3]*x[132]; - xdot[133] = p[3]*x[132]-p[3]*x[133]; - xdot[134] = p[3]*x[133]-p[3]*x[134]; - xdot[135] = -p[0]*w[0]*x[135]+k[1]*p[3]*w[2]*x[143]; - xdot[136] = p[0]*w[0]*x[135]-p[1]*x[1]*x[136]*4.0; - xdot[137] = -p[2]*x[137]+p[1]*x[1]*x[136]*2.0; - xdot[138] = -p[3]*x[138]+k[0]*p[2]*w[3]*x[137]; - xdot[139] = p[3]*x[138]*2.0-p[3]*x[139]; - xdot[140] = p[3]*x[139]-p[3]*x[140]; - xdot[141] = p[3]*x[140]-p[3]*x[141]; - xdot[142] = p[3]*x[141]-p[3]*x[142]; - xdot[143] = p[3]*x[142]-p[3]*x[143]; - xdot[144] = -p[0]*w[0]*x[144]+k[1]*p[3]*w[2]*x[152]; - xdot[145] = p[0]*w[0]*x[144]-p[1]*x[1]*x[145]*4.0; - xdot[146] = -p[2]*x[146]+p[1]*x[1]*x[145]*2.0; - xdot[147] = -p[3]*x[147]+k[0]*p[2]*w[3]*x[146]; - xdot[148] = p[3]*x[147]*2.0-p[3]*x[148]; - xdot[149] = p[3]*x[148]-p[3]*x[149]; - xdot[150] = p[3]*x[149]-p[3]*x[150]; - xdot[151] = p[3]*x[150]-p[3]*x[151]; - xdot[152] = p[3]*x[151]-p[3]*x[152]; - xdot[153] = -p[0]*w[0]*x[153]+k[1]*p[3]*w[2]*x[161]; - xdot[154] = p[0]*w[0]*x[153]-p[1]*x[1]*x[154]*4.0; - xdot[155] = -p[2]*x[155]+p[1]*x[1]*x[154]*2.0; - xdot[156] = -p[3]*x[156]+k[0]*p[2]*w[3]*x[155]; - xdot[157] = p[3]*x[156]*2.0-p[3]*x[157]; - xdot[158] = p[3]*x[157]-p[3]*x[158]; - xdot[159] = p[3]*x[158]-p[3]*x[159]; - xdot[160] = p[3]*x[159]-p[3]*x[160]; - xdot[161] = p[3]*x[160]-p[3]*x[161]; -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_jakstat_adjoint_o2/y.cpp b/models/model_jakstat_adjoint_o2/y.cpp deleted file mode 100644 index 17e3d938bc..0000000000 --- a/models/model_jakstat_adjoint_o2/y.cpp +++ /dev/null @@ -1,61 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_jakstat_adjoint_o2{ - -void y_model_jakstat_adjoint_o2(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = p[11]+(p[13]*(x[1]+x[2]*2.0))/p[4]; - y[1] = p[10]+(p[12]*(x[0]+x[1]+x[2]*2.0))/p[4]; - y[2] = amici::spline_pos(t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - y[3] = (p[13]*x[10])/p[4]+(p[13]*x[11]*2.0)/p[4]; - y[4] = (p[12]*x[9])/p[4]+(p[12]*x[10])/p[4]+(p[12]*x[11]*2.0)/p[4]; - y[6] = (p[13]*x[19])/p[4]+(p[13]*x[20]*2.0)/p[4]; - y[7] = (p[12]*x[18])/p[4]+(p[12]*x[19])/p[4]+(p[12]*x[20]*2.0)/p[4]; - y[9] = (p[13]*x[28])/p[4]+(p[13]*x[29]*2.0)/p[4]; - y[10] = (p[12]*x[27])/p[4]+(p[12]*x[28])/p[4]+(p[12]*x[29]*2.0)/p[4]; - y[12] = (p[13]*x[37])/p[4]+(p[13]*x[38]*2.0)/p[4]; - y[13] = (p[12]*x[36])/p[4]+(p[12]*x[37])/p[4]+(p[12]*x[38]*2.0)/p[4]; - y[15] = (p[13]*x[46])/p[4]+(p[13]*x[47]*2.0)/p[4]-1.0/(p[4]*p[4])*p[13]*(x[1]+x[2]*2.0); - y[16] = (p[12]*x[45])/p[4]+(p[12]*x[46])/p[4]+(p[12]*x[47]*2.0)/p[4]-1.0/(p[4]*p[4])*p[12]*(x[0]+x[1]+x[2]*2.0); - y[18] = (p[13]*x[55])/p[4]+(p[13]*x[56]*2.0)/p[4]; - y[19] = (p[12]*x[54])/p[4]+(p[12]*x[55])/p[4]+(p[12]*x[56]*2.0)/p[4]; - y[20] = amici::Dspline_pos(4,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - y[21] = (p[13]*x[64])/p[4]+(p[13]*x[65]*2.0)/p[4]; - y[22] = (p[12]*x[63])/p[4]+(p[12]*x[64])/p[4]+(p[12]*x[65]*2.0)/p[4]; - y[23] = amici::Dspline_pos(6,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - y[24] = (p[13]*x[73])/p[4]+(p[13]*x[74]*2.0)/p[4]; - y[25] = (p[12]*x[72])/p[4]+(p[12]*x[73])/p[4]+(p[12]*x[74]*2.0)/p[4]; - y[26] = amici::Dspline_pos(8,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - y[27] = (p[13]*x[82])/p[4]+(p[13]*x[83]*2.0)/p[4]; - y[28] = (p[12]*x[81])/p[4]+(p[12]*x[82])/p[4]+(p[12]*x[83]*2.0)/p[4]; - y[29] = amici::Dspline_pos(10,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - y[30] = (p[13]*x[91])/p[4]+(p[13]*x[92]*2.0)/p[4]; - y[31] = (p[12]*x[90])/p[4]+(p[12]*x[91])/p[4]+(p[12]*x[92]*2.0)/p[4]; - y[32] = amici::Dspline_pos(12,t,5,0.0,p[5],5.0,p[6],1.0E1,p[7],2.0E1,p[8],6.0E1,p[9],0.0,0.0); - y[33] = (p[13]*x[100])/p[4]+(p[13]*x[101]*2.0)/p[4]; - y[34] = (p[12]*x[99])/p[4]+(p[12]*x[100])/p[4]+(p[12]*x[101]*2.0)/p[4]+1.0; - y[36] = (p[13]*x[109])/p[4]+(p[13]*x[110]*2.0)/p[4]+1.0; - y[37] = (p[12]*x[108])/p[4]+(p[12]*x[109])/p[4]+(p[12]*x[110]*2.0)/p[4]; - y[39] = (p[13]*x[118])/p[4]+(p[13]*x[119]*2.0)/p[4]; - y[40] = (x[0]+x[1]+x[2]*2.0)/p[4]+(p[12]*x[117])/p[4]+(p[12]*x[118])/p[4]+(p[12]*x[119]*2.0)/p[4]; - y[42] = (x[1]+x[2]*2.0)/p[4]+(p[13]*x[127])/p[4]+(p[13]*x[128]*2.0)/p[4]; - y[43] = (p[12]*x[126])/p[4]+(p[12]*x[127])/p[4]+(p[12]*x[128]*2.0)/p[4]; - y[45] = (p[13]*x[136])/p[4]+(p[13]*x[137]*2.0)/p[4]; - y[46] = (p[12]*x[135])/p[4]+(p[12]*x[136])/p[4]+(p[12]*x[137]*2.0)/p[4]; - y[48] = (p[13]*x[145])/p[4]+(p[13]*x[146]*2.0)/p[4]; - y[49] = (p[12]*x[144])/p[4]+(p[12]*x[145])/p[4]+(p[12]*x[146]*2.0)/p[4]; - y[51] = (p[13]*x[154])/p[4]+(p[13]*x[155]*2.0)/p[4]; - y[52] = (p[12]*x[153])/p[4]+(p[12]*x[154])/p[4]+(p[12]*x[155]*2.0)/p[4]; -} - -} // namespace model_model_jakstat_adjoint_o2 - -} // namespace amici - diff --git a/models/model_nested_events/CMakeLists.txt b/models/model_nested_events/CMakeLists.txt deleted file mode 100644 index 0dc2b916bb..0000000000 --- a/models/model_nested_events/CMakeLists.txt +++ /dev/null @@ -1,121 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_nested_events) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/deltaqB.cpp -${MODEL_DIR}/deltasx.cpp -${MODEL_DIR}/deltax.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/root.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/stau.cpp -${MODEL_DIR}/sx0.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_nested_events/JSparse.cpp b/models/model_nested_events/JSparse.cpp deleted file mode 100644 index 9db399af7c..0000000000 --- a/models/model_nested_events/JSparse.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void JSparse_model_nested_events(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 1; - JSparse->data[0] = -p[4]-p[3]*(h[0]-1.0); -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/Jy.cpp b/models/model_nested_events/Jy.cpp deleted file mode 100644 index fe34fe3a19..0000000000 --- a/models/model_nested_events/Jy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void Jy_model_nested_events(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/dJydsigma.cpp b/models/model_nested_events/dJydsigma.cpp deleted file mode 100644 index 5bcf4e5faa..0000000000 --- a/models/model_nested_events/dJydsigma.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void dJydsigma_model_nested_events(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0]*1.0,2.0)*-1.0+1.0/sigmay[0]; - break; -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/dJydy.cpp b/models/model_nested_events/dJydy.cpp deleted file mode 100644 index 1b5d06f40f..0000000000 --- a/models/model_nested_events/dJydy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void dJydy_model_nested_events(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/deltaqB.cpp b/models/model_nested_events/deltaqB.cpp deleted file mode 100644 index e1e1571b52..0000000000 --- a/models/model_nested_events/deltaqB.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void deltaqB_model_nested_events(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) { -switch (ip) { -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/deltasx.cpp b/models/model_nested_events/deltasx.cpp deleted file mode 100644 index 15b55bb525..0000000000 --- a/models/model_nested_events/deltasx.cpp +++ /dev/null @@ -1,151 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void deltasx_model_nested_events(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 2: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 2: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0])+1.0; - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0])+1.0; - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 2: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 2: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - - case 4: { - switch(ie) { - case 0: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 1: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 2: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - case 3: { - deltasx[0] = -stau[0]*(xdot[0]-xdot_old[0]); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/deltax.cpp b/models/model_nested_events/deltax.cpp deleted file mode 100644 index ec62e695a1..0000000000 --- a/models/model_nested_events/deltax.cpp +++ /dev/null @@ -1,31 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void deltax_model_nested_events(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) { - switch(ie) { - case 2: { - deltax[0] = p[1]; - - } break; - - case 3: { - deltax[0] = p[1]; - - } break; - - } -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/dxdotdp.cpp b/models/model_nested_events/dxdotdp.cpp deleted file mode 100644 index 7d073f0701..0000000000 --- a/models/model_nested_events/dxdotdp.cpp +++ /dev/null @@ -1,31 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void dxdotdp_model_nested_events(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 3: { - dxdotdp[0] = -x[0]*(h[0]-1.0); - - } break; - - case 4: { - dxdotdp[0] = -x[0]; - - } break; - -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/dydx.cpp b/models/model_nested_events/dydx.cpp deleted file mode 100644 index add7a46983..0000000000 --- a/models/model_nested_events/dydx.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void dydx_model_nested_events(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0] = 1.0; -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/main.cpp b/models/model_nested_events/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_nested_events/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_nested_events/model_nested_events.h b/models/model_nested_events/model_nested_events.h deleted file mode 100644 index 0ca111adc7..0000000000 --- a/models/model_nested_events/model_nested_events.h +++ /dev/null @@ -1,216 +0,0 @@ -#ifndef _amici_model_nested_events_h -#define _amici_model_nested_events_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_nested_events{ - -extern void JSparse_model_nested_events(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jy_model_nested_events(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydsigma_model_nested_events(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_nested_events(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void deltaqB_model_nested_events(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB); -extern void deltasx_model_nested_events(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl); -extern void deltax_model_nested_events(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old); -extern void dxdotdp_model_nested_events(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_nested_events(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void root_model_nested_events(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl); -extern void sigmay_model_nested_events(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void stau_model_nested_events(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie); -extern void sx0_model_nested_events(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip); -extern void x0_model_nested_events(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_nested_events(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_nested_events(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); - -class Model_model_nested_events : public amici::Model_ODE { -public: - Model_model_nested_events() - : amici::Model_ODE( - amici::ModelDimensions( - 1, - 1, - 1, - 1, - 0, - 5, - 0, - 1, - 1, - 0, - 0, - 4, - 4, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - {}, - 0, - 0, - 0, - 1, - 0, - 0 - ), - amici::SimulationParameters( - std::vector(0, 1.0), - std::vector(5, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{0}, - std::vector{}) - {}; - - amici::Model* clone() const override { return new Model_model_nested_events(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_nested_events(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_nested_events(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_nested_events(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_nested_events(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - deltaqB_model_nested_events(deltaqB, t, x, p, k, h, ip, ie, xdot, xdot_old, xB); - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - deltasx_model_nested_events(deltasx, t, x, p, k, h, w, ip, ie, xdot, xdot_old, sx, stau, tcl); - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - deltax_model_nested_events(deltax, t, x, p, k, h, ie, xdot, xdot_old); - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_nested_events(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - root_model_nested_events(root, t, x, p, k, h, tcl); - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_nested_events(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - stau_model_nested_events(stau, t, x, p, k, h, tcl, sx, ip, ie); - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - sx0_model_nested_events(sx0, t, x0, p, k, ip); - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_nested_events(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_nested_events(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_nested_events(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - -}; - -} // namespace model_model_nested_events - -} // namespace amici - -#endif /* _amici_model_nested_events_h */ diff --git a/models/model_nested_events/rebuild_model_nested_events.m b/models/model_nested_events/rebuild_model_nested_events.m deleted file mode 100644 index 38f3e1b9cc..0000000000 --- a/models/model_nested_events/rebuild_model_nested_events.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_nested_events() -modelName = 'model_nested_events'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(1, 1, 5, 0, 0, 0, [], ['simulate_' modelName '.m'], 'model_nested_events', 'log10', 1, 1); -end diff --git a/models/model_nested_events/root.cpp b/models/model_nested_events/root.cpp deleted file mode 100644 index 0cf33d2d57..0000000000 --- a/models/model_nested_events/root.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void root_model_nested_events(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) { - root[0] = -x[0]+1.0; - root[1] = x[0]-1.0; - root[2] = t-p[2]; - root[3] = -t+p[2]; -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/sigmay.cpp b/models/model_nested_events/sigmay.cpp deleted file mode 100644 index 0f928ca69a..0000000000 --- a/models/model_nested_events/sigmay.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void sigmay_model_nested_events(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/stau.cpp b/models/model_nested_events/stau.cpp deleted file mode 100644 index bfaad2f012..0000000000 --- a/models/model_nested_events/stau.cpp +++ /dev/null @@ -1,143 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void stau_model_nested_events(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 1: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 1: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 1: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 2: { - stau[0] = 1.0; - - } break; - - case 3: { - stau[0] = 1.0; - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 1: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - } - - } break; - - case 4: { - switch(ie) { - case 0: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 1: { - stau[0] = sx[0]/(p[4]*x[0]+p[3]*x[0]*(h[0]-1.0)); - - } break; - - case 2: { - - } break; - - case 3: { - - } break; - - } - - } break; - -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/swig/CMakeLists.txt b/models/model_nested_events/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_nested_events/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_nested_events/swig/model_nested_events.i b/models/model_nested_events/swig/model_nested_events.i deleted file mode 100644 index bec3ccac55..0000000000 --- a/models/model_nested_events/swig/model_nested_events.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_nested_events -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_nested_events/sx0.cpp b/models/model_nested_events/sx0.cpp deleted file mode 100644 index 01a33b32a4..0000000000 --- a/models/model_nested_events/sx0.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void sx0_model_nested_events(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) { -switch (ip) { - case 0: { - sx0[0] = 1.0; - - } break; - -} -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/wrapfunctions.cpp b/models/model_nested_events/wrapfunctions.cpp deleted file mode 100644 index 190a4caa1a..0000000000 --- a/models/model_nested_events/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_nested_events::Model_model_nested_events()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_nested_events/wrapfunctions.h b/models/model_nested_events/wrapfunctions.h deleted file mode 100644 index 2eb9041ec4..0000000000 --- a/models/model_nested_events/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_nested_events.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_nested_events/x0.cpp b/models/model_nested_events/x0.cpp deleted file mode 100644 index ad0addfb6a..0000000000 --- a/models/model_nested_events/x0.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void x0_model_nested_events(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = p[0]; -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/xdot.cpp b/models/model_nested_events/xdot.cpp deleted file mode 100644 index 0fd26c1b75..0000000000 --- a/models/model_nested_events/xdot.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void xdot_model_nested_events(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = -p[4]*x[0]-p[3]*x[0]*(h[0]-1.0); -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_nested_events/y.cpp b/models/model_nested_events/y.cpp deleted file mode 100644 index 308c9ad8f5..0000000000 --- a/models/model_nested_events/y.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_nested_events{ - -void y_model_nested_events(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = x[0]; -} - -} // namespace model_model_nested_events - -} // namespace amici - diff --git a/models/model_neuron/CMakeLists.txt b/models/model_neuron/CMakeLists.txt deleted file mode 100644 index 8de63e6084..0000000000 --- a/models/model_neuron/CMakeLists.txt +++ /dev/null @@ -1,135 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_neuron) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jrz.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/Jz.cpp -${MODEL_DIR}/dJrzdsigma.cpp -${MODEL_DIR}/dJrzdz.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dJzdsigma.cpp -${MODEL_DIR}/dJzdz.cpp -${MODEL_DIR}/deltaqB.cpp -${MODEL_DIR}/deltasx.cpp -${MODEL_DIR}/deltax.cpp -${MODEL_DIR}/deltaxB.cpp -${MODEL_DIR}/drzdx.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/dzdx.cpp -${MODEL_DIR}/root.cpp -${MODEL_DIR}/rz.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/sigmaz.cpp -${MODEL_DIR}/srz.cpp -${MODEL_DIR}/stau.cpp -${MODEL_DIR}/sx0.cpp -${MODEL_DIR}/sz.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp -${MODEL_DIR}/z.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_neuron/JSparse.cpp b/models/model_neuron/JSparse.cpp deleted file mode 100644 index bb293ee60b..0000000000 --- a/models/model_neuron/JSparse.cpp +++ /dev/null @@ -1,31 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void JSparse_model_neuron(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 0; - JSparse->indexvals[3] = 1; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 2; - JSparse->indexptrs[2] = 4; - JSparse->data[0] = x[0]*(2.0/2.5E1)+5.0; - JSparse->data[1] = p[0]*p[1]; - JSparse->data[2] = -1.0; - JSparse->data[3] = -p[0]; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/Jrz.cpp b/models/model_neuron/Jrz.cpp deleted file mode 100644 index 506e4cb90c..0000000000 --- a/models/model_neuron/Jrz.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void Jrz_model_neuron(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - nllh[0] = amici::log((sigmaz[0]*sigmaz[0])*3.141592653589793*2.0)*5.0E-1+(rz[0]*rz[0])*1.0/(sigmaz[0]*sigmaz[0])*5.0E-1; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/Jy.cpp b/models/model_neuron/Jy.cpp deleted file mode 100644 index 34432dff69..0000000000 --- a/models/model_neuron/Jy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void Jy_model_neuron(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/Jz.cpp b/models/model_neuron/Jz.cpp deleted file mode 100644 index 7139094a91..0000000000 --- a/models/model_neuron/Jz.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void Jz_model_neuron(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - nllh[0] = amici::log((sigmaz[0]*sigmaz[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmaz[0]*sigmaz[0])*pow(mz[0]-z[0],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dJrzdsigma.cpp b/models/model_neuron/dJrzdsigma.cpp deleted file mode 100644 index 86144a4052..0000000000 --- a/models/model_neuron/dJrzdsigma.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dJrzdsigma_model_neuron(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - dJrzdsigma[0] = (rz[0]*rz[0])*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*-1.0+1.0/sigmaz[0]; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dJrzdz.cpp b/models/model_neuron/dJrzdz.cpp deleted file mode 100644 index f797c1433e..0000000000 --- a/models/model_neuron/dJrzdz.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dJrzdz_model_neuron(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - dJrzdz[0] = rz[0]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dJydsigma.cpp b/models/model_neuron/dJydsigma.cpp deleted file mode 100644 index 719f080743..0000000000 --- a/models/model_neuron/dJydsigma.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dJydsigma_model_neuron(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0]*1.0,2.0)*-1.0+1.0/sigmay[0]; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dJydy.cpp b/models/model_neuron/dJydy.cpp deleted file mode 100644 index 7a6dc85c87..0000000000 --- a/models/model_neuron/dJydy.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dJydy_model_neuron(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dJzdsigma.cpp b/models/model_neuron/dJzdsigma.cpp deleted file mode 100644 index a321ec18d6..0000000000 --- a/models/model_neuron/dJzdsigma.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dJzdsigma_model_neuron(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - dJzdsigma[0] = 1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*pow(mz[0]-z[0]*1.0,2.0)*-1.0+1.0/sigmaz[0]; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dJzdz.cpp b/models/model_neuron/dJzdz.cpp deleted file mode 100644 index 14cf0a3e07..0000000000 --- a/models/model_neuron/dJzdz.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dJzdz_model_neuron(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - dJzdz[0] = 1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/deltaqB.cpp b/models/model_neuron/deltaqB.cpp deleted file mode 100644 index 1cc27dbbe1..0000000000 --- a/models/model_neuron/deltaqB.cpp +++ /dev/null @@ -1,43 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void deltaqB_model_neuron(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) { -switch (ip) { - case 2: { - switch(ie) { - case 0: { - deltaqB[0] = xB[0]; - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - deltaqB[0] = -xB[1]; - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/deltasx.cpp b/models/model_neuron/deltasx.cpp deleted file mode 100644 index 29bd503840..0000000000 --- a/models/model_neuron/deltasx.cpp +++ /dev/null @@ -1,69 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void deltasx_model_neuron(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-1.0; - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1])+1.0; - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/deltax.cpp b/models/model_neuron/deltax.cpp deleted file mode 100644 index 7fdf2e3724..0000000000 --- a/models/model_neuron/deltax.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void deltax_model_neuron(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) { - switch(ie) { - case 0: { - deltax[0] = -p[2]-x[0]; - deltax[1] = p[3]; - - } break; - - } -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/deltaxB.cpp b/models/model_neuron/deltaxB.cpp deleted file mode 100644 index 3e45e3ba8a..0000000000 --- a/models/model_neuron/deltaxB.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void deltaxB_model_neuron(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) { - switch(ie) { - case 0: { - deltaxB[0] = xB[0]; - - } break; - - } -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/drzdx.cpp b/models/model_neuron/drzdx.cpp deleted file mode 100644 index 7bf19536e7..0000000000 --- a/models/model_neuron/drzdx.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void drzdx_model_neuron(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - drzdx[0+0*1] = 1.0; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dxdotdp.cpp b/models/model_neuron/dxdotdp.cpp deleted file mode 100644 index e866012713..0000000000 --- a/models/model_neuron/dxdotdp.cpp +++ /dev/null @@ -1,31 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dxdotdp_model_neuron(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[1] = -x[1]+p[1]*x[0]; - - } break; - - case 1: { - dxdotdp[1] = p[0]*x[0]; - - } break; - -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dydx.cpp b/models/model_neuron/dydx.cpp deleted file mode 100644 index e6c0a52abf..0000000000 --- a/models/model_neuron/dydx.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dydx_model_neuron(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+0*1] = 1.0; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/dzdx.cpp b/models/model_neuron/dzdx.cpp deleted file mode 100644 index 20b1638399..0000000000 --- a/models/model_neuron/dzdx.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void dzdx_model_neuron(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - dzdx[0+0*1] = -1.0/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/main.cpp b/models/model_neuron/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_neuron/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_neuron/model_neuron.h b/models/model_neuron/model_neuron.h deleted file mode 100644 index 99fb505d60..0000000000 --- a/models/model_neuron/model_neuron.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef _amici_model_neuron_h -#define _amici_model_neuron_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_neuron{ - -extern void JSparse_model_neuron(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jrz_model_neuron(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void Jy_model_neuron(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void Jz_model_neuron(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void dJrzdsigma_model_neuron(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void dJrzdz_model_neuron(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void dJydsigma_model_neuron(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_neuron(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJzdsigma_model_neuron(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void dJzdz_model_neuron(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void deltaqB_model_neuron(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB); -extern void deltasx_model_neuron(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl); -extern void deltax_model_neuron(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old); -extern void deltaxB_model_neuron(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB); -extern void drzdx_model_neuron(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void dxdotdp_model_neuron(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_neuron(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void dzdx_model_neuron(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void root_model_neuron(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl); -extern void rz_model_neuron(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void sigmay_model_neuron(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void sigmaz_model_neuron(double *sigmaz, const realtype t, const realtype *p, const realtype *k); -extern void srz_model_neuron(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip); -extern void stau_model_neuron(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie); -extern void sx0_model_neuron(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip); -extern void sz_model_neuron(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip); -extern void x0_model_neuron(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_neuron(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_neuron(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void z_model_neuron(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); - -class Model_model_neuron : public amici::Model_ODE { -public: - Model_model_neuron() - : amici::Model_ODE( - amici::ModelDimensions( - 2, - 2, - 2, - 2, - 0, - 4, - 2, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - {}, - 0, - 0, - 0, - 4, - 1, - 1 - ), - amici::SimulationParameters( - std::vector(2, 1.0), - std::vector(4, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{0, 0}, - std::vector{1}) - {}; - - amici::Model* clone() const override { return new Model_model_neuron(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_neuron(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - Jrz_model_neuron(nllh, iz, p, k, rz, sigmaz); - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_neuron(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - Jz_model_neuron(nllh, iz, p, k, z, sigmaz, mz); - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - dJrzdsigma_model_neuron(dJrzdsigma, iz, p, k, rz, sigmaz); - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - dJrzdz_model_neuron(dJrzdz, iz, p, k, rz, sigmaz); - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_neuron(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_neuron(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - dJzdsigma_model_neuron(dJzdsigma, iz, p, k, z, sigmaz, mz); - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - dJzdz_model_neuron(dJzdz, iz, p, k, z, sigmaz, mz); - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - deltaqB_model_neuron(deltaqB, t, x, p, k, h, ip, ie, xdot, xdot_old, xB); - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - deltasx_model_neuron(deltasx, t, x, p, k, h, w, ip, ie, xdot, xdot_old, sx, stau, tcl); - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - deltax_model_neuron(deltax, t, x, p, k, h, ie, xdot, xdot_old); - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - deltaxB_model_neuron(deltaxB, t, x, p, k, h, ie, xdot, xdot_old, xB); - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - drzdx_model_neuron(drzdx, ie, t, x, p, k, h); - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_neuron(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - dzdx_model_neuron(dzdx, ie, t, x, p, k, h); - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - root_model_neuron(root, t, x, p, k, h, tcl); - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - rz_model_neuron(rz, ie, t, x, p, k, h); - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_neuron(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - sigmaz_model_neuron(sigmaz, t, p, k); - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - srz_model_neuron(srz, ie, t, x, p, k, h, sx, ip); - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - stau_model_neuron(stau, t, x, p, k, h, tcl, sx, ip, ie); - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - sx0_model_neuron(sx0, t, x0, p, k, ip); - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - sz_model_neuron(sz, ie, t, x, p, k, h, sx, ip); - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_neuron(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_neuron(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_neuron(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - z_model_neuron(z, ie, t, x, p, k, h); - } - -}; - -} // namespace model_model_neuron - -} // namespace amici - -#endif /* _amici_model_neuron_h */ diff --git a/models/model_neuron/rebuild_model_neuron.m b/models/model_neuron/rebuild_model_neuron.m deleted file mode 100644 index 0c368819dc..0000000000 --- a/models/model_neuron/rebuild_model_neuron.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_neuron() -modelName = 'model_neuron'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(2, 1, 4, 2, 1, 0, [], ['simulate_' modelName '.m'], 'model_neuron', 'log10', 1, 1); -end diff --git a/models/model_neuron/root.cpp b/models/model_neuron/root.cpp deleted file mode 100644 index 6a68f67719..0000000000 --- a/models/model_neuron/root.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void root_model_neuron(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) { - root[0] = x[0]-3.0E1; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/rz.cpp b/models/model_neuron/rz.cpp deleted file mode 100644 index a85f19c886..0000000000 --- a/models/model_neuron/rz.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void rz_model_neuron(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - switch(ie) { - case 0: { - rz[0] = x[0]-3.0E1; - - } break; - - } -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/sigmay.cpp b/models/model_neuron/sigmay.cpp deleted file mode 100644 index 8bc0d292f8..0000000000 --- a/models/model_neuron/sigmay.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void sigmay_model_neuron(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/sigmaz.cpp b/models/model_neuron/sigmaz.cpp deleted file mode 100644 index ce17fae268..0000000000 --- a/models/model_neuron/sigmaz.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void sigmaz_model_neuron(double *sigmaz, const realtype t, const realtype *p, const realtype *k) { - sigmaz[0] = 1.0; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/srz.cpp b/models/model_neuron/srz.cpp deleted file mode 100644 index 19ff0285c3..0000000000 --- a/models/model_neuron/srz.cpp +++ /dev/null @@ -1,65 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void srz_model_neuron(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/stau.cpp b/models/model_neuron/stau.cpp deleted file mode 100644 index d77cfb5bdc..0000000000 --- a/models/model_neuron/stau.cpp +++ /dev/null @@ -1,65 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void stau_model_neuron(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/swig/CMakeLists.txt b/models/model_neuron/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_neuron/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_neuron/swig/model_neuron.i b/models/model_neuron/swig/model_neuron.i deleted file mode 100644 index 856ba04978..0000000000 --- a/models/model_neuron/swig/model_neuron.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_neuron -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_neuron/sx0.cpp b/models/model_neuron/sx0.cpp deleted file mode 100644 index 3712b90049..0000000000 --- a/models/model_neuron/sx0.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void sx0_model_neuron(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) { -switch (ip) { - case 1: { - sx0[1] = k[0]; - - } break; - -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/sz.cpp b/models/model_neuron/sz.cpp deleted file mode 100644 index e82da414f6..0000000000 --- a/models/model_neuron/sz.cpp +++ /dev/null @@ -1,65 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void sz_model_neuron(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/wrapfunctions.cpp b/models/model_neuron/wrapfunctions.cpp deleted file mode 100644 index 74dc0ab024..0000000000 --- a/models/model_neuron/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_neuron::Model_model_neuron()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_neuron/wrapfunctions.h b/models/model_neuron/wrapfunctions.h deleted file mode 100644 index dee20b752a..0000000000 --- a/models/model_neuron/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_neuron.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_neuron/x0.cpp b/models/model_neuron/x0.cpp deleted file mode 100644 index 348a787e27..0000000000 --- a/models/model_neuron/x0.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void x0_model_neuron(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = k[0]; - x0[1] = k[0]*p[1]; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/xdot.cpp b/models/model_neuron/xdot.cpp deleted file mode 100644 index c39724e74e..0000000000 --- a/models/model_neuron/xdot.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void xdot_model_neuron(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2; - xdot[1] = -p[0]*(x[1]-p[1]*x[0]); -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/y.cpp b/models/model_neuron/y.cpp deleted file mode 100644 index 97818ac920..0000000000 --- a/models/model_neuron/y.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void y_model_neuron(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = x[0]; -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron/z.cpp b/models/model_neuron/z.cpp deleted file mode 100644 index 9571db0448..0000000000 --- a/models/model_neuron/z.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron{ - -void z_model_neuron(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - switch(ie) { - case 0: { - z[0] = t; - - } break; - - } -} - -} // namespace model_model_neuron - -} // namespace amici - diff --git a/models/model_neuron_o2/CMakeLists.txt b/models/model_neuron_o2/CMakeLists.txt deleted file mode 100644 index 1caad81d23..0000000000 --- a/models/model_neuron_o2/CMakeLists.txt +++ /dev/null @@ -1,137 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_neuron_o2) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jrz.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/Jz.cpp -${MODEL_DIR}/dJrzdsigma.cpp -${MODEL_DIR}/dJrzdz.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dJzdsigma.cpp -${MODEL_DIR}/dJzdz.cpp -${MODEL_DIR}/deltaqB.cpp -${MODEL_DIR}/deltasx.cpp -${MODEL_DIR}/deltax.cpp -${MODEL_DIR}/deltaxB.cpp -${MODEL_DIR}/drzdx.cpp -${MODEL_DIR}/dwdx.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/dzdx.cpp -${MODEL_DIR}/root.cpp -${MODEL_DIR}/rz.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/sigmaz.cpp -${MODEL_DIR}/srz.cpp -${MODEL_DIR}/stau.cpp -${MODEL_DIR}/sx0.cpp -${MODEL_DIR}/sz.cpp -${MODEL_DIR}/w.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp -${MODEL_DIR}/z.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_neuron_o2/JSparse.cpp b/models/model_neuron_o2/JSparse.cpp deleted file mode 100644 index 1ef9bc119b..0000000000 --- a/models/model_neuron_o2/JSparse.cpp +++ /dev/null @@ -1,85 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void JSparse_model_neuron_o2(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 2; - JSparse->indexvals[3] = 3; - JSparse->indexvals[4] = 4; - JSparse->indexvals[5] = 5; - JSparse->indexvals[6] = 6; - JSparse->indexvals[7] = 8; - JSparse->indexvals[8] = 0; - JSparse->indexvals[9] = 1; - JSparse->indexvals[10] = 3; - JSparse->indexvals[11] = 2; - JSparse->indexvals[12] = 3; - JSparse->indexvals[13] = 2; - JSparse->indexvals[14] = 3; - JSparse->indexvals[15] = 4; - JSparse->indexvals[16] = 5; - JSparse->indexvals[17] = 4; - JSparse->indexvals[18] = 5; - JSparse->indexvals[19] = 6; - JSparse->indexvals[20] = 7; - JSparse->indexvals[21] = 6; - JSparse->indexvals[22] = 7; - JSparse->indexvals[23] = 8; - JSparse->indexvals[24] = 9; - JSparse->indexvals[25] = 8; - JSparse->indexvals[26] = 9; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 8; - JSparse->indexptrs[2] = 11; - JSparse->indexptrs[3] = 13; - JSparse->indexptrs[4] = 15; - JSparse->indexptrs[5] = 17; - JSparse->indexptrs[6] = 19; - JSparse->indexptrs[7] = 21; - JSparse->indexptrs[8] = 23; - JSparse->indexptrs[9] = 25; - JSparse->indexptrs[10] = 27; - JSparse->data[0] = x[0]*(2.0/2.5E1)+5.0; - JSparse->data[1] = p[0]*p[1]; - JSparse->data[2] = x[2]*dwdx[1]; - JSparse->data[3] = p[1]; - JSparse->data[4] = x[4]*dwdx[1]; - JSparse->data[5] = p[0]; - JSparse->data[6] = x[6]*dwdx[1]; - JSparse->data[7] = x[8]*dwdx[1]; - JSparse->data[8] = -1.0; - JSparse->data[9] = -p[0]; - JSparse->data[10] = -1.0; - JSparse->data[11] = w[1]; - JSparse->data[12] = p[0]*p[1]; - JSparse->data[13] = -1.0; - JSparse->data[14] = -p[0]; - JSparse->data[15] = w[1]; - JSparse->data[16] = p[0]*p[1]; - JSparse->data[17] = -1.0; - JSparse->data[18] = -p[0]; - JSparse->data[19] = w[1]; - JSparse->data[20] = p[0]*p[1]; - JSparse->data[21] = -1.0; - JSparse->data[22] = -p[0]; - JSparse->data[23] = w[1]; - JSparse->data[24] = p[0]*p[1]; - JSparse->data[25] = -1.0; - JSparse->data[26] = -p[0]; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/Jrz.cpp b/models/model_neuron_o2/Jrz.cpp deleted file mode 100644 index a2f3b57e40..0000000000 --- a/models/model_neuron_o2/Jrz.cpp +++ /dev/null @@ -1,28 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void Jrz_model_neuron_o2(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - nllh[0] = amici::log((sigmaz[0]*sigmaz[0])*3.141592653589793*2.0)*5.0E-1+(rz[0]*rz[0])*1.0/(sigmaz[0]*sigmaz[0])*5.0E-1; - nllh[1] = rz[0]*rz[1]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - nllh[2] = rz[0]*rz[2]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - nllh[3] = rz[0]*rz[3]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - nllh[4] = rz[0]*rz[4]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/Jy.cpp b/models/model_neuron_o2/Jy.cpp deleted file mode 100644 index 6df39fa045..0000000000 --- a/models/model_neuron_o2/Jy.cpp +++ /dev/null @@ -1,28 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void Jy_model_neuron_o2(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - nllh[1] = y[1]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[2] = y[2]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[3] = y[3]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - nllh[4] = y[4]*1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/Jz.cpp b/models/model_neuron_o2/Jz.cpp deleted file mode 100644 index aa263ca005..0000000000 --- a/models/model_neuron_o2/Jz.cpp +++ /dev/null @@ -1,28 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void Jz_model_neuron_o2(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - nllh[0] = amici::log((sigmaz[0]*sigmaz[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmaz[0]*sigmaz[0])*pow(mz[0]-z[0],2.0)*5.0E-1; - nllh[1] = z[1]*1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - nllh[2] = z[2]*1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - nllh[3] = z[3]*1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - nllh[4] = z[4]*1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dJrzdsigma.cpp b/models/model_neuron_o2/dJrzdsigma.cpp deleted file mode 100644 index b6a0e08a66..0000000000 --- a/models/model_neuron_o2/dJrzdsigma.cpp +++ /dev/null @@ -1,28 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dJrzdsigma_model_neuron_o2(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - dJrzdsigma[0+0*5] = (rz[0]*rz[0])*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*-1.0+1.0/sigmaz[0]; - dJrzdsigma[1+0*5] = rz[0]*rz[1]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*-2.0; - dJrzdsigma[2+0*5] = rz[0]*rz[2]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*-2.0; - dJrzdsigma[3+0*5] = rz[0]*rz[3]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*-2.0; - dJrzdsigma[4+0*5] = rz[0]*rz[4]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*-2.0; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dJrzdz.cpp b/models/model_neuron_o2/dJrzdz.cpp deleted file mode 100644 index 84963ae35b..0000000000 --- a/models/model_neuron_o2/dJrzdz.cpp +++ /dev/null @@ -1,32 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dJrzdz_model_neuron_o2(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) { -switch(iz){ - case 0: - dJrzdz[0+0*5] = rz[0]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[1+0*5] = rz[1]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[1+1*5] = rz[0]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[2+0*5] = rz[2]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[2+2*5] = rz[0]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[3+0*5] = rz[3]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[3+3*5] = rz[0]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[4+0*5] = rz[4]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJrzdz[4+4*5] = rz[0]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dJydsigma.cpp b/models/model_neuron_o2/dJydsigma.cpp deleted file mode 100644 index 4313cb2c7e..0000000000 --- a/models/model_neuron_o2/dJydsigma.cpp +++ /dev/null @@ -1,28 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dJydsigma_model_neuron_o2(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0+0*5] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*-1.0+1.0/sigmay[0]; - dJydsigma[1+0*5] = y[1]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[2+0*5] = y[2]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[3+0*5] = y[3]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - dJydsigma[4+0*5] = y[4]*1.0/(sigmay[0]*sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*1.0; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dJydy.cpp b/models/model_neuron_o2/dJydy.cpp deleted file mode 100644 index 673a2eb12b..0000000000 --- a/models/model_neuron_o2/dJydy.cpp +++ /dev/null @@ -1,32 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dJydy_model_neuron_o2(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0+0*5] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[1+0*5] = y[1]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[1+1*5] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[2+0*5] = y[2]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[2+2*5] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[3+0*5] = y[3]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[3+3*5] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - dJydy[4+0*5] = y[4]*1.0/(sigmay[0]*sigmay[0])*1.0; - dJydy[4+4*5] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dJzdsigma.cpp b/models/model_neuron_o2/dJzdsigma.cpp deleted file mode 100644 index 8b2465d46a..0000000000 --- a/models/model_neuron_o2/dJzdsigma.cpp +++ /dev/null @@ -1,28 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dJzdsigma_model_neuron_o2(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - dJzdsigma[0+0*5] = 1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*pow(mz[0]-z[0],2.0)*-1.0+1.0/sigmaz[0]; - dJzdsigma[1+0*5] = z[1]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*1.0; - dJzdsigma[2+0*5] = z[2]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*1.0; - dJzdsigma[3+0*5] = z[3]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*1.0; - dJzdsigma[4+0*5] = z[4]*1.0/(sigmaz[0]*sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*1.0; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dJzdz.cpp b/models/model_neuron_o2/dJzdz.cpp deleted file mode 100644 index 96ba0d2540..0000000000 --- a/models/model_neuron_o2/dJzdz.cpp +++ /dev/null @@ -1,32 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dJzdz_model_neuron_o2(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) { -switch(iz){ - case 0: - dJzdz[0+0*5] = 1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - dJzdz[1+0*5] = z[1]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJzdz[1+1*5] = 1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - dJzdz[2+0*5] = z[2]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJzdz[2+2*5] = 1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - dJzdz[3+0*5] = z[3]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJzdz[3+3*5] = 1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - dJzdz[4+0*5] = z[4]*1.0/(sigmaz[0]*sigmaz[0])*1.0; - dJzdz[4+4*5] = 1.0/(sigmaz[0]*sigmaz[0])*(mz[0]*2.0-z[0]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/deltaqB.cpp b/models/model_neuron_o2/deltaqB.cpp deleted file mode 100644 index 7e19de1c0e..0000000000 --- a/models/model_neuron_o2/deltaqB.cpp +++ /dev/null @@ -1,65 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void deltaqB_model_neuron_o2(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - deltaqB[0] = (x[2]*xB[3]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[4]*xB[5]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[6]*xB[7]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[8]*xB[9]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - deltaqB[0] = (x[2]*xB[3]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[4]*xB[5]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[6]*xB[7]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[8]*xB[9]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - deltaqB[0] = xB[0]-(x[2]*xB[2]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[4]*xB[4]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[6]*xB[6]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[8]*xB[8]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*p[1]*x[2]*xB[3])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*p[1]*x[4]*xB[5])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*p[1]*x[6]*xB[7])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*p[1]*x[8]*xB[9])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - deltaqB[0] = -xB[1]+(x[2]*xB[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[4]*xB[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[6]*xB[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(x[8]*xB[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*x[2]*xB[3])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*x[4]*xB[5])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*x[6]*xB[7])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(p[0]*x[8]*xB[9])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/deltasx.cpp b/models/model_neuron_o2/deltasx.cpp deleted file mode 100644 index 10c0d6a052..0000000000 --- a/models/model_neuron_o2/deltasx.cpp +++ /dev/null @@ -1,101 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void deltasx_model_neuron_o2(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - deltasx[2] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[2]-xdot_old[2])-((sx[2]-stau[0]*(x[3]-w[1]*x[2]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[3] = -stau[0]*(xdot[3]-xdot_old[3])-((p[0]*p[1]*x[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[2]-stau[0]*(x[3]-w[1]*x[2])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[2]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[4] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[4]-xdot_old[4])-((sx[4]-stau[0]*(x[5]-w[1]*x[4]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[5] = -stau[0]*(xdot[5]-xdot_old[5])-((p[0]*p[1]*x[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[4]-stau[0]*(x[5]-w[1]*x[4])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[4]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[6] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[6]-xdot_old[6])-((sx[6]-stau[0]*(x[7]-w[1]*x[6]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[7] = -stau[0]*(xdot[7]-xdot_old[7])-((p[0]*p[1]*x[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[6]-stau[0]*(x[7]-w[1]*x[6])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[6]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[8] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[8]-xdot_old[8])-((sx[8]-stau[0]*(x[9]-w[1]*x[8]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[9] = -stau[0]*(xdot[9]-xdot_old[9])-((p[0]*p[1]*x[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[8]-stau[0]*(x[9]-w[1]*x[8])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[8]*(p[3]+p[1]*p[2]+p[1]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - deltasx[2] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[2]-xdot_old[2])-((sx[2]-stau[0]*(x[3]-w[1]*x[2]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[3] = -stau[0]*(xdot[3]-xdot_old[3])-((p[0]*p[1]*x[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[2]-stau[0]*(x[3]-w[1]*x[2])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[2]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[4] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[4]-xdot_old[4])-((sx[4]-stau[0]*(x[5]-w[1]*x[4]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[5] = -stau[0]*(xdot[5]-xdot_old[5])-((p[0]*p[1]*x[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[4]-stau[0]*(x[5]-w[1]*x[4])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[4]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[6] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[6]-xdot_old[6])-((sx[6]-stau[0]*(x[7]-w[1]*x[6]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[7] = -stau[0]*(xdot[7]-xdot_old[7])-((p[0]*p[1]*x[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[6]-stau[0]*(x[7]-w[1]*x[6])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[6]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[8] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[8]-xdot_old[8])-((sx[8]-stau[0]*(x[9]-w[1]*x[8]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[9] = -stau[0]*(xdot[9]-xdot_old[9])-((p[0]*p[1]*x[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[8]-stau[0]*(x[9]-w[1]*x[8])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(x[8]*(p[0]*p[2]+p[0]*x[0]))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-1.0; - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1]); - deltasx[2] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[2]-xdot_old[2])+(x[2]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[2]-stau[0]*(x[3]-w[1]*x[2]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[3] = -stau[0]*(xdot[3]-xdot_old[3])-((p[0]*p[1]*x[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[2]-stau[0]*(x[3]-w[1]*x[2])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*p[1]*x[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[4] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[4]-xdot_old[4])+(x[4]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[4]-stau[0]*(x[5]-w[1]*x[4]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[5] = -stau[0]*(xdot[5]-xdot_old[5])-((p[0]*p[1]*x[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[4]-stau[0]*(x[5]-w[1]*x[4])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*p[1]*x[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[6] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[6]-xdot_old[6])+(x[6]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[6]-stau[0]*(x[7]-w[1]*x[6]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[7] = -stau[0]*(xdot[7]-xdot_old[7])-((p[0]*p[1]*x[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[6]-stau[0]*(x[7]-w[1]*x[6])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*p[1]*x[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[8] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[8]-xdot_old[8])+(x[8]*(p[2]*(2.0/2.5E1)-5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[8]-stau[0]*(x[9]-w[1]*x[8]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[9] = -stau[0]*(xdot[9]-xdot_old[9])-((p[0]*p[1]*x[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[8]-stau[0]*(x[9]-w[1]*x[8])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*p[1]*x[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - deltasx[0] = -sx[0]-stau[0]*(xdot[0]-xdot_old[0])-stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltasx[1] = -stau[0]*(xdot[1]-xdot_old[1])+1.0; - deltasx[2] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[2]-xdot_old[2])-x[2]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[2]-stau[0]*(x[3]-w[1]*x[2]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[3] = -stau[0]*(xdot[3]-xdot_old[3])-((p[0]*p[1]*x[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[2]-stau[0]*(x[3]-w[1]*x[2])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*x[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[4] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[4]-xdot_old[4])-x[4]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[4]-stau[0]*(x[5]-w[1]*x[4]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[5] = -stau[0]*(xdot[5]-xdot_old[5])-((p[0]*p[1]*x[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[4]-stau[0]*(x[5]-w[1]*x[4])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*x[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[6] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[6]-xdot_old[6])-x[6]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[6]-stau[0]*(x[7]-w[1]*x[6]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[7] = -stau[0]*(xdot[7]-xdot_old[7])-((p[0]*p[1]*x[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[6]-stau[0]*(x[7]-w[1]*x[6])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*x[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - deltasx[8] = -(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))-stau[0]*(xdot[8]-xdot_old[8])-x[8]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-((sx[8]-stau[0]*(x[9]-w[1]*x[8]))*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltasx[9] = -stau[0]*(xdot[9]-xdot_old[9])-((p[0]*p[1]*x[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*(sx[0]+stau[0]*(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2))-((p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*(sx[8]-stau[0]*(x[9]-w[1]*x[8])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(p[0]*x[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(sx[1]-p[0]*stau[0]*(x[1]-p[1]*x[0]))*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/deltax.cpp b/models/model_neuron_o2/deltax.cpp deleted file mode 100644 index c77cf46cf5..0000000000 --- a/models/model_neuron_o2/deltax.cpp +++ /dev/null @@ -1,35 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void deltax_model_neuron_o2(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) { - switch(ie) { - case 0: { - deltax[0] = -p[2]-x[0]; - deltax[1] = p[3]; - deltax[2] = -(x[2]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltax[3] = -(x[2]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltax[4] = -(x[4]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltax[5] = -(x[4]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltax[6] = -(x[6]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-1.0; - deltax[7] = -(x[6]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltax[8] = -(x[8]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltax[9] = -(x[8]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+1.0; - - } break; - - } -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/deltaxB.cpp b/models/model_neuron_o2/deltaxB.cpp deleted file mode 100644 index 7d804618ee..0000000000 --- a/models/model_neuron_o2/deltaxB.cpp +++ /dev/null @@ -1,31 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void deltaxB_model_neuron_o2(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) { - switch(ie) { - case 0: { - deltaxB[0] = xB[0]+xB[2]*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))+xB[4]*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))+xB[6]*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))+xB[8]*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))+xB[3]*((p[0]*p[1]*x[2])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))+xB[5]*((p[0]*p[1]*x[4])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))+xB[7]*((p[0]*p[1]*x[6])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))+xB[9]*((p[0]*p[1]*x[8])/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)); - deltaxB[1] = x[2]*xB[3]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)+x[4]*xB[5]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)+x[6]*xB[7]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)+x[8]*xB[9]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0]))*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)+x[2]*xB[2]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1))+x[4]*xB[4]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1))+x[6]*xB[6]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1))+x[8]*xB[8]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)); - deltaxB[2] = (xB[3]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(xB[2]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltaxB[4] = (xB[5]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(xB[4]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltaxB[6] = (xB[7]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(xB[6]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - deltaxB[8] = (xB[9]*(p[0]*(p[3]+x[1]+p[1]*p[2])-p[0]*(x[1]-p[1]*x[0])))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+(xB[8]*(p[2]*5.0+p[3]+x[0]*5.0-(p[2]*p[2])*(1.0/2.5E1)+(x[0]*x[0])*(1.0/2.5E1)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/drzdx.cpp b/models/model_neuron_o2/drzdx.cpp deleted file mode 100644 index 17787035bd..0000000000 --- a/models/model_neuron_o2/drzdx.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void drzdx_model_neuron_o2(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - drzdx[0+0*5] = 1.0; - drzdx[1+2*5] = 1.0; - drzdx[2+4*5] = 1.0; - drzdx[3+6*5] = 1.0; - drzdx[4+8*5] = 1.0; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dwdx.cpp b/models/model_neuron_o2/dwdx.cpp deleted file mode 100644 index 3a2036c023..0000000000 --- a/models/model_neuron_o2/dwdx.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dwdx_model_neuron_o2(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) { - dwdx[0] = 2.0/2.5E1; - dwdx[1] = dwdx[0]; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dxdotdp.cpp b/models/model_neuron_o2/dxdotdp.cpp deleted file mode 100644 index e9d6c535ea..0000000000 --- a/models/model_neuron_o2/dxdotdp.cpp +++ /dev/null @@ -1,39 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dxdotdp_model_neuron_o2(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[1] = -x[1]+p[1]*x[0]; - dxdotdp[3] = -x[3]+p[1]*x[2]; - dxdotdp[5] = x[0]-x[5]+p[1]*x[4]; - dxdotdp[7] = -x[7]+p[1]*x[6]; - dxdotdp[9] = -x[9]+p[1]*x[8]; - - } break; - - case 1: { - dxdotdp[1] = p[0]*x[0]; - dxdotdp[3] = x[0]+p[0]*x[2]; - dxdotdp[5] = p[0]*x[4]; - dxdotdp[7] = p[0]*x[6]; - dxdotdp[9] = p[0]*x[8]; - - } break; - -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dydx.cpp b/models/model_neuron_o2/dydx.cpp deleted file mode 100644 index 9776535163..0000000000 --- a/models/model_neuron_o2/dydx.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dydx_model_neuron_o2(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+0*5] = 1.0; - dydx[1+2*5] = 1.0; - dydx[2+4*5] = 1.0; - dydx[3+6*5] = 1.0; - dydx[4+8*5] = 1.0; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/dzdx.cpp b/models/model_neuron_o2/dzdx.cpp deleted file mode 100644 index 7c60b2b6e9..0000000000 --- a/models/model_neuron_o2/dzdx.cpp +++ /dev/null @@ -1,32 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void dzdx_model_neuron_o2(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - dzdx[0+0*5] = -1.0/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - dzdx[1+0*5] = x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[1+1*5] = -x[2]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[1+2*5] = -1.0/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - dzdx[2+0*5] = x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[2+1*5] = -x[4]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[2+4*5] = -1.0/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - dzdx[3+0*5] = x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[3+1*5] = -x[6]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[3+6*5] = -1.0/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - dzdx[4+0*5] = x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[4+1*5] = -x[8]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0); - dzdx[4+8*5] = -1.0/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/main.cpp b/models/model_neuron_o2/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_neuron_o2/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_neuron_o2/model_neuron_o2.h b/models/model_neuron_o2/model_neuron_o2.h deleted file mode 100644 index f29e1c88f3..0000000000 --- a/models/model_neuron_o2/model_neuron_o2.h +++ /dev/null @@ -1,248 +0,0 @@ -#ifndef _amici_model_neuron_o2_h -#define _amici_model_neuron_o2_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_neuron_o2{ - -extern void JSparse_model_neuron_o2(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jrz_model_neuron_o2(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void Jy_model_neuron_o2(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void Jz_model_neuron_o2(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void dJrzdsigma_model_neuron_o2(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void dJrzdz_model_neuron_o2(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz); -extern void dJydsigma_model_neuron_o2(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_neuron_o2(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJzdsigma_model_neuron_o2(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void dJzdz_model_neuron_o2(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz); -extern void deltaqB_model_neuron_o2(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB); -extern void deltasx_model_neuron_o2(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl); -extern void deltax_model_neuron_o2(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old); -extern void deltaxB_model_neuron_o2(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB); -extern void drzdx_model_neuron_o2(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void dwdx_model_neuron_o2(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static); -extern void dxdotdp_model_neuron_o2(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_neuron_o2(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void dzdx_model_neuron_o2(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void root_model_neuron_o2(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl); -extern void rz_model_neuron_o2(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); -extern void sigmay_model_neuron_o2(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void sigmaz_model_neuron_o2(double *sigmaz, const realtype t, const realtype *p, const realtype *k); -extern void srz_model_neuron_o2(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip); -extern void stau_model_neuron_o2(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie); -extern void sx0_model_neuron_o2(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip); -extern void sz_model_neuron_o2(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip); -extern void w_model_neuron_o2(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static); -extern void x0_model_neuron_o2(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_neuron_o2(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_neuron_o2(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void z_model_neuron_o2(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); - -class Model_model_neuron_o2 : public amici::Model_ODE { -public: - Model_model_neuron_o2() - : amici::Model_ODE( - amici::ModelDimensions( - 10, - 2, - 10, - 2, - 0, - 4, - 2, - 5, - 1, - 5, - 1, - 1, - 1, - 0, - 5, - 2, - 2, - 0, - 0, - 0, - {}, - 0, - 0, - 0, - 27, - 1, - 8 - ), - amici::SimulationParameters( - std::vector(2, 1.0), - std::vector(4, 1.0) - ), - amici::SecondOrderMode::full, - std::vector{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - std::vector{1, 1, 1, 1, 1}) - {}; - - amici::Model* clone() const override { return new Model_model_neuron_o2(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_neuron_o2(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - Jrz_model_neuron_o2(nllh, iz, p, k, rz, sigmaz); - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_neuron_o2(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - Jz_model_neuron_o2(nllh, iz, p, k, z, sigmaz, mz); - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - dJrzdsigma_model_neuron_o2(dJrzdsigma, iz, p, k, rz, sigmaz); - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - dJrzdz_model_neuron_o2(dJrzdz, iz, p, k, rz, sigmaz); - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_neuron_o2(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_neuron_o2(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - dJzdsigma_model_neuron_o2(dJzdsigma, iz, p, k, z, sigmaz, mz); - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - dJzdz_model_neuron_o2(dJzdz, iz, p, k, z, sigmaz, mz); - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - deltaqB_model_neuron_o2(deltaqB, t, x, p, k, h, ip, ie, xdot, xdot_old, xB); - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - deltasx_model_neuron_o2(deltasx, t, x, p, k, h, w, ip, ie, xdot, xdot_old, sx, stau, tcl); - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - deltax_model_neuron_o2(deltax, t, x, p, k, h, ie, xdot, xdot_old); - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - deltaxB_model_neuron_o2(deltaxB, t, x, p, k, h, ie, xdot, xdot_old, xB); - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - drzdx_model_neuron_o2(drzdx, ie, t, x, p, k, h); - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - dwdx_model_neuron_o2(dwdx, t, x, p, k, h, w, tcl, spl, include_static); - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_neuron_o2(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - } - - void fdydx(double *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_o2(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - dzdx_model_neuron_o2(dzdx, ie, t, x, p, k, h); - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - root_model_neuron_o2(root, t, x, p, k, h, tcl); - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - rz_model_neuron_o2(rz, ie, t, x, p, k, h); - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_neuron_o2(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - sigmaz_model_neuron_o2(sigmaz, t, p, k); - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - srz_model_neuron_o2(srz, ie, t, x, p, k, h, sx, ip); - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - stau_model_neuron_o2(stau, t, x, p, k, h, tcl, sx, ip, ie); - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - sx0_model_neuron_o2(sx0, t, x0, p, k, ip); - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - sz_model_neuron_o2(sz, ie, t, x, p, k, h, sx, ip); - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - w_model_neuron_o2(w, t, x, p, k, h, tcl, spl, include_static); - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_neuron_o2(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_neuron_o2(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_neuron_o2(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - z_model_neuron_o2(z, ie, t, x, p, k, h); - } - -}; - -} // namespace model_model_neuron_o2 - -} // namespace amici - -#endif /* _amici_model_neuron_o2_h */ diff --git a/models/model_neuron_o2/root.cpp b/models/model_neuron_o2/root.cpp deleted file mode 100644 index 7fba331de0..0000000000 --- a/models/model_neuron_o2/root.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void root_model_neuron_o2(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) { - root[0] = x[0]-3.0E1; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/rz.cpp b/models/model_neuron_o2/rz.cpp deleted file mode 100644 index ff5a6c1f8c..0000000000 --- a/models/model_neuron_o2/rz.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void rz_model_neuron_o2(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - switch(ie) { - case 0: { - rz[0] = x[0]-3.0E1; - rz[1] = x[2]; - rz[2] = x[4]; - rz[3] = x[6]; - rz[4] = x[8]; - - } break; - - } -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/sigmay.cpp b/models/model_neuron_o2/sigmay.cpp deleted file mode 100644 index 3e5743cb70..0000000000 --- a/models/model_neuron_o2/sigmay.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void sigmay_model_neuron_o2(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/sigmaz.cpp b/models/model_neuron_o2/sigmaz.cpp deleted file mode 100644 index 8ef2b748ab..0000000000 --- a/models/model_neuron_o2/sigmaz.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void sigmaz_model_neuron_o2(double *sigmaz, const realtype t, const realtype *p, const realtype *k) { - sigmaz[0] = 1.0; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/srz.cpp b/models/model_neuron_o2/srz.cpp deleted file mode 100644 index 22c9a50f4f..0000000000 --- a/models/model_neuron_o2/srz.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void srz_model_neuron_o2(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - srz[1] = sx[2]; - srz[2] = sx[4]; - srz[3] = sx[6]; - srz[4] = sx[8]; - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - srz[1] = sx[2]; - srz[2] = sx[4]; - srz[3] = sx[6]; - srz[4] = sx[8]; - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - srz[1] = sx[2]; - srz[2] = sx[4]; - srz[3] = sx[6]; - srz[4] = sx[8]; - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - srz[0] = sx[0]; - srz[1] = sx[2]; - srz[2] = sx[4]; - srz[3] = sx[6]; - srz[4] = sx[8]; - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/stau.cpp b/models/model_neuron_o2/stau.cpp deleted file mode 100644 index c639781b90..0000000000 --- a/models/model_neuron_o2/stau.cpp +++ /dev/null @@ -1,65 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void stau_model_neuron_o2(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - stau[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/swig/CMakeLists.txt b/models/model_neuron_o2/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_neuron_o2/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_neuron_o2/swig/model_neuron_o2.i b/models/model_neuron_o2/swig/model_neuron_o2.i deleted file mode 100644 index 6c9c51ddb2..0000000000 --- a/models/model_neuron_o2/swig/model_neuron_o2.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_neuron_o2 -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_neuron_o2/sx0.cpp b/models/model_neuron_o2/sx0.cpp deleted file mode 100644 index 4fdd5f4a24..0000000000 --- a/models/model_neuron_o2/sx0.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void sx0_model_neuron_o2(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) { -switch (ip) { - case 1: { - sx0[1] = k[0]; - - } break; - -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/sz.cpp b/models/model_neuron_o2/sz.cpp deleted file mode 100644 index 9720d84418..0000000000 --- a/models/model_neuron_o2/sz.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void sz_model_neuron_o2(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) { -switch (ip) { - case 0: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[1] = x[2]*(x[3]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*-2.0-sx[2]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[2]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[2] = -x[4]*(x[3]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[2]*(x[5]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[4]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[4]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[3] = -x[6]*(x[3]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[2]*(x[7]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[6]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[6]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[4] = -x[8]*(x[3]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[2]*(x[9]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[8]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[8]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 1: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[1] = -x[4]*(x[3]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[2]*(x[5]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[2]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[2]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[2] = x[4]*(x[5]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*-2.0-sx[4]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[4]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[3] = -x[6]*(x[5]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[4]*(x[7]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[6]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[6]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[4] = -x[8]*(x[5]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[4]*(x[9]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[8]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[8]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 2: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[1] = -x[6]*(x[3]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[2]*(x[7]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[2]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[2]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[2] = -x[6]*(x[5]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[4]*(x[7]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[4]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[4]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[3] = x[6]*(x[7]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*-2.0-sx[6]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[6]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[4] = -x[8]*(x[7]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[6]*(x[9]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[8]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[8]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - - case 3: { - switch(ie) { - case 0: { - sz[0] = -sx[0]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[1] = -x[8]*(x[3]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[2]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[2]*(x[9]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[2]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[2]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[2]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[2] = -x[8]*(x[5]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[4]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[4]*(x[9]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[4]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[4]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[4]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[3] = -x[8]*(x[7]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[6]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-x[6]*(x[9]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))-sx[6]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[6]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[6]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - sz[4] = x[8]*(x[9]*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)-x[8]*(x[0]*(2.0/2.5E1)+5.0)*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0))*-2.0-sx[8]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)-(sx[0]*((x[8]*(x[0]*(2.0/2.5E1)+5.0))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2)+p[0]*x[8]*(x[1]-p[1]*x[0])*1.0/pow(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2,2.0)))/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } - - } break; - -} -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/w.cpp b/models/model_neuron_o2/w.cpp deleted file mode 100644 index fca88b9e36..0000000000 --- a/models/model_neuron_o2/w.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void w_model_neuron_o2(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) { - w[0] = x[0]*(2.0/2.5E1); - w[1] = w[0]+5.0; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/wrapfunctions.cpp b/models/model_neuron_o2/wrapfunctions.cpp deleted file mode 100644 index 572bd4a1fc..0000000000 --- a/models/model_neuron_o2/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_neuron_o2::Model_model_neuron_o2()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_neuron_o2/wrapfunctions.h b/models/model_neuron_o2/wrapfunctions.h deleted file mode 100644 index 52c7094f90..0000000000 --- a/models/model_neuron_o2/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_neuron_o2.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_neuron_o2/x0.cpp b/models/model_neuron_o2/x0.cpp deleted file mode 100644 index 0a997336b3..0000000000 --- a/models/model_neuron_o2/x0.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void x0_model_neuron_o2(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = k[0]; - x0[1] = k[0]*p[1]; - x0[5] = k[0]; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/xdot.cpp b/models/model_neuron_o2/xdot.cpp deleted file mode 100644 index 809a83fa76..0000000000 --- a/models/model_neuron_o2/xdot.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void xdot_model_neuron_o2(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2; - xdot[1] = -p[0]*(x[1]-p[1]*x[0]); - xdot[2] = -x[3]+w[1]*x[2]; - xdot[3] = -x[1]+p[1]*x[0]-p[0]*x[3]+p[0]*p[1]*x[2]; - xdot[4] = -x[5]+w[1]*x[4]; - xdot[5] = p[0]*x[0]-p[0]*x[5]+p[0]*p[1]*x[4]; - xdot[6] = -x[7]+w[1]*x[6]; - xdot[7] = -p[0]*x[7]+p[0]*p[1]*x[6]; - xdot[8] = -x[9]+w[1]*x[8]; - xdot[9] = -p[0]*x[9]+p[0]*p[1]*x[8]; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/y.cpp b/models/model_neuron_o2/y.cpp deleted file mode 100644 index f6aef48c86..0000000000 --- a/models/model_neuron_o2/y.cpp +++ /dev/null @@ -1,24 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void y_model_neuron_o2(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = x[0]; - y[1] = x[2]; - y[2] = x[4]; - y[3] = x[6]; - y[4] = x[8]; -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_neuron_o2/z.cpp b/models/model_neuron_o2/z.cpp deleted file mode 100644 index 18af0194f4..0000000000 --- a/models/model_neuron_o2/z.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_neuron_o2{ - -void z_model_neuron_o2(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) { - switch(ie) { - case 0: { - z[0] = t; - z[1] = -x[2]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - z[2] = -x[4]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - z[3] = -x[6]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - z[4] = -x[8]/(k[1]+x[0]*5.0-x[1]+(x[0]*x[0])*(1.0/2.5E1)+1.4E2); - - } break; - - } -} - -} // namespace model_model_neuron_o2 - -} // namespace amici - diff --git a/models/model_robertson/CMakeLists.txt b/models/model_robertson/CMakeLists.txt deleted file mode 100644 index b9c6c2ecb1..0000000000 --- a/models/model_robertson/CMakeLists.txt +++ /dev/null @@ -1,119 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_robertson) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/M.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dwdp.cpp -${MODEL_DIR}/dwdx.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/w.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_robertson/JSparse.cpp b/models/model_robertson/JSparse.cpp deleted file mode 100644 index 46c0faa1d3..0000000000 --- a/models/model_robertson/JSparse.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void JSparse_model_robertson(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 2; - JSparse->indexvals[3] = 0; - JSparse->indexvals[4] = 1; - JSparse->indexvals[5] = 2; - JSparse->indexvals[6] = 0; - JSparse->indexvals[7] = 1; - JSparse->indexvals[8] = 2; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 3; - JSparse->indexptrs[2] = 6; - JSparse->indexptrs[3] = 9; - JSparse->data[0] = -cj-p[0]; - JSparse->data[1] = p[0]; - JSparse->data[2] = 1.0; - JSparse->data[3] = dwdx[0]; - JSparse->data[4] = -cj-dwdx[0]-p[2]*x[1]*2.0; - JSparse->data[5] = 1.0; - JSparse->data[6] = dwdx[1]; - JSparse->data[7] = -dwdx[1]; - JSparse->data[8] = 1.0; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/Jy.cpp b/models/model_robertson/Jy.cpp deleted file mode 100644 index f3f5fe1a80..0000000000 --- a/models/model_robertson/Jy.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void Jy_model_robertson(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; - case 1: - nllh[0] = amici::log((sigmay[1]*sigmay[1])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*5.0E-1; - break; - case 2: - nllh[0] = amici::log((sigmay[2]*sigmay[2])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/M.cpp b/models/model_robertson/M.cpp deleted file mode 100644 index 51b497e8fc..0000000000 --- a/models/model_robertson/M.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void M_model_robertson(realtype *M, const realtype t, const realtype *x, const realtype *p, const realtype *k) { - M[0+0*3] = 1.0; - M[1+1*3] = 1.0; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/dJydsigma.cpp b/models/model_robertson/dJydsigma.cpp deleted file mode 100644 index b4a4419f8a..0000000000 --- a/models/model_robertson/dJydsigma.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void dJydsigma_model_robertson(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0+0*1] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*-1.0+1.0/sigmay[0]; - break; - case 1: - dJydsigma[0+1*1] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*-1.0+1.0/sigmay[1]; - break; - case 2: - dJydsigma[0+2*1] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*-1.0+1.0/sigmay[2]; - break; -} -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/dJydy.cpp b/models/model_robertson/dJydy.cpp deleted file mode 100644 index 6b337d31ea..0000000000 --- a/models/model_robertson/dJydy.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void dJydy_model_robertson(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0+0*1] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; - case 1: - dJydy[0+1*1] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - break; - case 2: - dJydy[0+2*1] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/dwdp.cpp b/models/model_robertson/dwdp.cpp deleted file mode 100644 index 5911b99078..0000000000 --- a/models/model_robertson/dwdp.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void dwdp_model_robertson(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) { - dwdp[0] = x[1]*x[2]; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/dwdx.cpp b/models/model_robertson/dwdx.cpp deleted file mode 100644 index 1e75c29246..0000000000 --- a/models/model_robertson/dwdx.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void dwdx_model_robertson(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) { - dwdx[0] = p[1]*x[2]; - dwdx[1] = p[1]*x[1]; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/dxdotdp.cpp b/models/model_robertson/dxdotdp.cpp deleted file mode 100644 index 0067e86b88..0000000000 --- a/models/model_robertson/dxdotdp.cpp +++ /dev/null @@ -1,38 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void dxdotdp_model_robertson(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *dx, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[0] = -x[0]; - dxdotdp[1] = x[0]; - - } break; - - case 1: { - dxdotdp[0] = dwdp[0]; - dxdotdp[1] = -dwdp[0]; - - } break; - - case 2: { - dxdotdp[1] = -x[1]*x[1]; - - } break; - -} -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/dydx.cpp b/models/model_robertson/dydx.cpp deleted file mode 100644 index 5ffe7dab16..0000000000 --- a/models/model_robertson/dydx.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void dydx_model_robertson(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+0*3] = 1.0; - dydx[1+1*3] = 1.0E4; - dydx[2+2*3] = 1.0; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/main.cpp b/models/model_robertson/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_robertson/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_robertson/model_robertson.h b/models/model_robertson/model_robertson.h deleted file mode 100644 index ef524b9239..0000000000 --- a/models/model_robertson/model_robertson.h +++ /dev/null @@ -1,215 +0,0 @@ -#ifndef _amici_model_robertson_h -#define _amici_model_robertson_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_idas.h" -#include "amici/model_dae.h" - -namespace amici { - -class Solver; - -namespace model_model_robertson{ - -extern void JSparse_model_robertson(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx); -extern void Jy_model_robertson(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void M_model_robertson(realtype *M, const realtype t, const realtype *x, const realtype *p, const realtype *k); -extern void dJydsigma_model_robertson(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_robertson(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dwdp_model_robertson(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static); -extern void dwdx_model_robertson(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static); -extern void dxdotdp_model_robertson(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *dx, const realtype *w, const realtype *dwdp); -extern void dydx_model_robertson(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void sigmay_model_robertson(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void w_model_robertson(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static); -extern void x0_model_robertson(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_robertson(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w); -extern void y_model_robertson(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); - -class Model_model_robertson : public amici::Model_DAE { -public: - Model_model_robertson() - : amici::Model_DAE( - amici::ModelDimensions( - 3, - 3, - 3, - 3, - 0, - 3, - 1, - 3, - 3, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 2, - 1, - 0, - 0, - {}, - 0, - 0, - 0, - 9, - 2, - 2 - ), - amici::SimulationParameters( - std::vector(1, 1.0), - std::vector(3, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{1, 1, 0}, - std::vector{}) - {}; - - amici::Model* clone() const override { return new Model_model_robertson(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) override { - JSparse_model_robertson(JSparse, t, x, p, k, h, cj, dx, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_robertson(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fM(realtype *M, const realtype t, const realtype *x, const realtype *p, const realtype *k) override { - M_model_robertson(M, t, x, p, k); - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_robertson(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_robertson(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - dwdp_model_robertson(dwdp, t, x, p, k, h, w, tcl, stcl, spl, sspl, include_static); - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - dwdx_model_robertson(dwdx, t, x, p, k, h, w, tcl, spl, include_static); - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *dx, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_robertson(dxdotdp, t, x, p, k, h, ip, dx, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx) override { - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_robertson(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - w_model_robertson(w, t, x, p, k, h, tcl, spl, include_static); - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_robertson(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w) override { - xdot_model_robertson(xdot, t, x, p, k, h, dx, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_robertson(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - -}; - -} // namespace model_model_robertson - -} // namespace amici - -#endif /* _amici_model_robertson_h */ diff --git a/models/model_robertson/rebuild_model_robertson.m b/models/model_robertson/rebuild_model_robertson.m deleted file mode 100644 index 3fcf9fe467..0000000000 --- a/models/model_robertson/rebuild_model_robertson.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_robertson() -modelName = 'model_robertson'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(3, 3, 3, 1, 0, 0, [], ['simulate_' modelName '.m'], 'model_robertson', 'log10', 1, 1); -end diff --git a/models/model_robertson/sigmay.cpp b/models/model_robertson/sigmay.cpp deleted file mode 100644 index 9e1e5e019c..0000000000 --- a/models/model_robertson/sigmay.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void sigmay_model_robertson(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; - sigmay[1] = 1.0; - sigmay[2] = 1.0; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/swig/CMakeLists.txt b/models/model_robertson/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_robertson/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_robertson/swig/model_robertson.i b/models/model_robertson/swig/model_robertson.i deleted file mode 100644 index a6b8705783..0000000000 --- a/models/model_robertson/swig/model_robertson.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_robertson -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_robertson/w.cpp b/models/model_robertson/w.cpp deleted file mode 100644 index ae4145ba6b..0000000000 --- a/models/model_robertson/w.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void w_model_robertson(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) { - w[0] = p[1]*x[1]*x[2]; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/wrapfunctions.cpp b/models/model_robertson/wrapfunctions.cpp deleted file mode 100644 index 31b42cd13f..0000000000 --- a/models/model_robertson/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_robertson::Model_model_robertson()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_robertson/wrapfunctions.h b/models/model_robertson/wrapfunctions.h deleted file mode 100644 index 0771b13b6e..0000000000 --- a/models/model_robertson/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_robertson.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_robertson/x0.cpp b/models/model_robertson/x0.cpp deleted file mode 100644 index ce0f24bfc5..0000000000 --- a/models/model_robertson/x0.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void x0_model_robertson(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = k[0]; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/xdot.cpp b/models/model_robertson/xdot.cpp deleted file mode 100644 index a756a318a9..0000000000 --- a/models/model_robertson/xdot.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void xdot_model_robertson(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w) { - xdot[0] = w[0]-dx[0]-p[0]*x[0]; - xdot[1] = -w[0]-dx[1]+p[0]*x[0]-p[2]*(x[1]*x[1]); - xdot[2] = x[0]+x[1]+x[2]-1.0; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_robertson/y.cpp b/models/model_robertson/y.cpp deleted file mode 100644 index 9e66126e99..0000000000 --- a/models/model_robertson/y.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_robertson{ - -void y_model_robertson(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = x[0]; - y[1] = x[1]*1.0E4; - y[2] = x[2]; -} - -} // namespace model_model_robertson - -} // namespace amici - diff --git a/models/model_steadystate/CMakeLists.txt b/models/model_steadystate/CMakeLists.txt deleted file mode 100644 index 05d04f8081..0000000000 --- a/models/model_steadystate/CMakeLists.txt +++ /dev/null @@ -1,118 +0,0 @@ -# Build AMICI model -cmake_minimum_required(VERSION 3.22) -cmake_policy(VERSION 3.22...3.30) - -project(model_steadystate) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -include(CheckCXXCompilerFlag) -set(MY_CXX_FLAGS -Wall -Wno-unused-function -Wno-unused-variable) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND MY_CXX_FLAGS -Wno-unused-but-set-variable) -endif() -foreach(flag ${MY_CXX_FLAGS}) - unset(CUR_FLAG_SUPPORTED CACHE) - check_cxx_compiler_flag(${flag} CUR_FLAG_SUPPORTED) - if(${CUR_FLAG_SUPPORTED}) - string(APPEND CMAKE_CXX_FLAGS " ${flag}") - endif() -endforeach() - -if(DEFINED ENV{AMICI_CXXFLAGS}) - message(STATUS "Appending flags from AMICI_CXXFLAGS: $ENV{AMICI_CXXFLAGS}") - add_compile_options("$ENV{AMICI_CXXFLAGS}") -endif() -if(DEFINED ENV{AMICI_LDFLAGS}) - message(STATUS "Appending flags from AMICI_LDFLAGS: $ENV{AMICI_LDFLAGS}") - link_libraries("$ENV{AMICI_LDFLAGS}") -endif() - -find_package(Amici REQUIRED HINTS - ${CMAKE_CURRENT_LIST_DIR}/../../build) -message(STATUS "Found AMICI ${Amici_DIR}") -set_target_properties(Upstream::amici PROPERTIES - MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo;Release; - MAP_IMPORTED_CONFIG_RELEASE Release - MAP_IMPORTED_CONFIG_DEBUG Debug;RelWithDebInfo;) - -# Debug build? -if("$ENV{ENABLE_AMICI_DEBUGGING}" OR "$ENV{ENABLE_GCOV_COVERAGE}") - add_compile_options(-UNDEBUG) - if(MSVC) - add_compile_options(-DEBUG) - else() - add_compile_options(-O0 -g) - endif() -endif() - -# coverage options -if($ENV{ENABLE_GCOV_COVERAGE}) - string(APPEND CMAKE_CXX_FLAGS_DEBUG " --coverage") - string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " --coverage") -endif() - -set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR}) - -set(SRC_LIST_LIB ${MODEL_DIR}/JSparse.cpp -${MODEL_DIR}/Jy.cpp -${MODEL_DIR}/dJydsigma.cpp -${MODEL_DIR}/dJydy.cpp -${MODEL_DIR}/dwdp.cpp -${MODEL_DIR}/dwdx.cpp -${MODEL_DIR}/dxdotdp.cpp -${MODEL_DIR}/dydx.cpp -${MODEL_DIR}/sigmay.cpp -${MODEL_DIR}/w.cpp -${MODEL_DIR}/x0.cpp -${MODEL_DIR}/xdot.cpp -${MODEL_DIR}/y.cpp - ${MODEL_DIR}/wrapfunctions.cpp) - -add_library(${PROJECT_NAME} ${SRC_LIST_LIB}) -add_library(model ALIAS ${PROJECT_NAME}) - -# Some special functions require boost -# -# TODO: set some flag during code generation whether the given model requires -# boost. for now, try to find it, add include directories and link against it. -# let the compiler/linker error if it is required but not found -find_package(Boost) - -target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -target_link_libraries( - ${PROJECT_NAME} - PUBLIC Upstream::amici - PRIVATE $<$:Boost::boost>) - -if(NOT "${AMICI_PYTHON_BUILD_EXT_ONLY}") - set(SRC_LIST_EXE main.cpp) - add_executable(simulate_${PROJECT_NAME} ${SRC_LIST_EXE}) - target_link_libraries(simulate_${PROJECT_NAME} ${PROJECT_NAME}) -endif() - -# SWIG -option(ENABLE_SWIG "Build swig/python library?" ON) -if(ENABLE_SWIG) - add_subdirectory(swig) -endif() - -# -include(GNUInstallDirs) -install( - TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -export( - EXPORT ${PROJECT_NAME}Targets - FILE ${PROJECT_NAME}Config.cmake - NAMESPACE Upstream::) -# diff --git a/models/model_steadystate/JSparse.cpp b/models/model_steadystate/JSparse.cpp deleted file mode 100644 index 7cd519d68a..0000000000 --- a/models/model_steadystate/JSparse.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -#include //SUNMatrixContent_Sparse definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void JSparse_model_steadystate(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - JSparse->indexvals[0] = 0; - JSparse->indexvals[1] = 1; - JSparse->indexvals[2] = 2; - JSparse->indexvals[3] = 0; - JSparse->indexvals[4] = 1; - JSparse->indexvals[5] = 2; - JSparse->indexvals[6] = 0; - JSparse->indexvals[7] = 1; - JSparse->indexvals[8] = 2; - JSparse->indexptrs[0] = 0; - JSparse->indexptrs[1] = 3; - JSparse->indexptrs[2] = 6; - JSparse->indexptrs[3] = 9; - JSparse->data[0] = -p[1]*x[1]-p[0]*dwdx[0]*2.0; - JSparse->data[1] = -p[1]*x[1]+p[0]*dwdx[0]; - JSparse->data[2] = p[1]*x[1]; - JSparse->data[3] = p[2]*2.0-p[1]*x[0]; - JSparse->data[4] = -p[2]-p[1]*x[0]; - JSparse->data[5] = p[1]*x[0]; - JSparse->data[6] = dwdx[1]; - JSparse->data[7] = dwdx[1]; - JSparse->data[8] = -k[3]-dwdx[1]; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/Jy.cpp b/models/model_steadystate/Jy.cpp deleted file mode 100644 index c2e5258216..0000000000 --- a/models/model_steadystate/Jy.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void Jy_model_steadystate(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - nllh[0] = amici::log((sigmay[0]*sigmay[0])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*5.0E-1; - break; - case 1: - nllh[0] = amici::log((sigmay[1]*sigmay[1])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*5.0E-1; - break; - case 2: - nllh[0] = amici::log((sigmay[2]*sigmay[2])*3.141592653589793*2.0)*5.0E-1+1.0/(sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*5.0E-1; - break; -} -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/dJydsigma.cpp b/models/model_steadystate/dJydsigma.cpp deleted file mode 100644 index 3b1d5259da..0000000000 --- a/models/model_steadystate/dJydsigma.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void dJydsigma_model_steadystate(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydsigma[0+0*1] = 1.0/(sigmay[0]*sigmay[0]*sigmay[0])*pow(my[0]-y[0],2.0)*-1.0+1.0/sigmay[0]; - break; - case 1: - dJydsigma[0+1*1] = 1.0/(sigmay[1]*sigmay[1]*sigmay[1])*pow(my[1]-y[1],2.0)*-1.0+1.0/sigmay[1]; - break; - case 2: - dJydsigma[0+2*1] = 1.0/(sigmay[2]*sigmay[2]*sigmay[2])*pow(my[2]-y[2],2.0)*-1.0+1.0/sigmay[2]; - break; -} -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/dJydy.cpp b/models/model_steadystate/dJydy.cpp deleted file mode 100644 index 137c754b4e..0000000000 --- a/models/model_steadystate/dJydy.cpp +++ /dev/null @@ -1,30 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void dJydy_model_steadystate(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) { -switch(iy){ - case 0: - dJydy[0+0*1] = 1.0/(sigmay[0]*sigmay[0])*(my[0]*2.0-y[0]*2.0)*-5.0E-1; - break; - case 1: - dJydy[0+1*1] = 1.0/(sigmay[1]*sigmay[1])*(my[1]*2.0-y[1]*2.0)*-5.0E-1; - break; - case 2: - dJydy[0+2*1] = 1.0/(sigmay[2]*sigmay[2])*(my[2]*2.0-y[2]*2.0)*-5.0E-1; - break; -} -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/dwdp.cpp b/models/model_steadystate/dwdp.cpp deleted file mode 100644 index d31310d341..0000000000 --- a/models/model_steadystate/dwdp.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void dwdp_model_steadystate(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) { - dwdp[0] = x[2]; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/dwdx.cpp b/models/model_steadystate/dwdx.cpp deleted file mode 100644 index dcd5f5e49e..0000000000 --- a/models/model_steadystate/dwdx.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void dwdx_model_steadystate(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) { - dwdx[0] = x[0]*2.0; - dwdx[1] = p[3]; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/dxdotdp.cpp b/models/model_steadystate/dxdotdp.cpp deleted file mode 100644 index 0ed5e880cb..0000000000 --- a/models/model_steadystate/dxdotdp.cpp +++ /dev/null @@ -1,52 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void dxdotdp_model_steadystate(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) { -switch (ip) { - case 0: { - dxdotdp[0] = w[1]*-2.0; - dxdotdp[1] = w[1]; - - } break; - - case 1: { - dxdotdp[0] = -x[0]*x[1]; - dxdotdp[1] = -x[0]*x[1]; - dxdotdp[2] = x[0]*x[1]; - - } break; - - case 2: { - dxdotdp[0] = x[1]*2.0; - dxdotdp[1] = -x[1]; - - } break; - - case 3: { - dxdotdp[0] = dwdp[0]; - dxdotdp[1] = dwdp[0]; - dxdotdp[2] = -dwdp[0]; - - } break; - - case 4: { - dxdotdp[0] = 1.0; - - } break; - -} -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/dydx.cpp b/models/model_steadystate/dydx.cpp deleted file mode 100644 index 3f69ca1c4c..0000000000 --- a/models/model_steadystate/dydx.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void dydx_model_steadystate(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) { - dydx[0+0*3] = 1.0; - dydx[1+1*3] = 1.0; - dydx[2+2*3] = 1.0; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/main.cpp b/models/model_steadystate/main.cpp deleted file mode 100644 index ecdff85a46..0000000000 --- a/models/model_steadystate/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include - -#include "wrapfunctions.h" /* model-provided functions */ -#include /* AMICI base functions */ - -template -std::ostream& operator<<(std::ostream& os, std::vector const& v) { - os << "["; - for (typename std::vector::const_iterator ii = v.begin(); ii != v.end(); - ++ii) { - os << " " << *ii; - } - os << "]"; - return os; -} - -/* - * This is a scaffold for a stand-alone AMICI simulation executable - * demonstrating the basic use of the AMICI C++ API. - */ - -int main() { - std::cout << "********************************" << std::endl; - std::cout << "** Running forward simulation **" << std::endl; - std::cout << "********************************" << std::endl << std::endl; - - // Create a model instance - auto model = amici::generic_model::getModel(); - - // Set desired output timepoints - model->setTimepoints({0.0, 1.0, 10.0, 100.0, 1000.0}); - - // Create a solver instance - auto solver = model->getSolver(); - - // Optionally set integration tolerance - solver->setAbsoluteTolerance(1e-16); - solver->setRelativeTolerance(1e-8); - - // Run the simulation using default parameters set during model import - // (can be changed using model->setParameters() or model->setParameterBy*()) - auto rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print observable time course - auto observable_ids = model->getObservableIds(); - std::cout << "Simulated observables for timepoints " << rdata->ts << "\n\n"; - for (int i_observable = 0; i_observable < rdata->ny; ++i_observable) { - std::cout << observable_ids[i_observable] << ":\n\t"; - for (int i_time = 0; i_time < rdata->nt; ++i_time) { - // rdata->y is a flat 2D array in row-major ordering - std::cout << rdata->y[i_time * rdata->ny + i_observable] << " "; - } - std::cout << std::endl << std::endl; - } - - std::cout << std::endl; - std::cout << "**********************************" << std::endl; - std::cout << "** Forward sensitivity analysis **" << std::endl; - std::cout << "**********************************" << std::endl << std::endl; - - // Enable first-order sensitivity analysis - solver->setSensitivityOrder(amici::SensitivityOrder::first); - // Use forward sensitivities - solver->setSensitivityMethod(amici::SensitivityMethod::forward); - - // Run the simulation - rdata = runAmiciSimulation(*solver, nullptr, *model); - - // Print state sensitivities sx... - // ... for the first timepoint... - int i_time = 0; - // ... with respect to the first parameter - int i_nplist = 0; - - // get identifiers from model - auto state_ids = model->getStateIds(); - auto parameter_ids = model->getParameterIds(); - - std::cout << "State sensitivities for timepoint " << rdata->ts[i_time] - << std::endl; // nt x nplist x nx - for (int i_state = 0; i_state < rdata->nx; ++i_state) { - std::cout << "\td(" << state_ids[i_state] << ")/d(" - << parameter_ids[model->plist(i_nplist)] << ") = "; - - // rdata->sx is a flat 3D array in row-major ordering - std::cout << rdata->sx - [i_time * rdata->nplist * rdata->nx - + i_nplist * rdata->nx + i_state]; - std::cout << std::endl; - } - - return 0; -} diff --git a/models/model_steadystate/model_steadystate.h b/models/model_steadystate/model_steadystate.h deleted file mode 100644 index a27a5a74df..0000000000 --- a/models/model_steadystate/model_steadystate.h +++ /dev/null @@ -1,210 +0,0 @@ -#ifndef _amici_model_steadystate_h -#define _amici_model_steadystate_h -/* Generated by amiwrap (R2017b) d69c026f8f8a89a13f1fa1307548f2b8f7045fe1 */ -#include -#include -#include "amici/defines.h" -#include //SUNMatrixContent_Sparse definition -#include "amici/solver_cvodes.h" -#include "amici/model_ode.h" - -namespace amici { - -class Solver; - -namespace model_model_steadystate{ - -extern void JSparse_model_steadystate(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void Jy_model_steadystate(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydsigma_model_steadystate(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dJydy_model_steadystate(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my); -extern void dwdp_model_steadystate(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static); -extern void dwdx_model_steadystate(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static); -extern void dxdotdp_model_steadystate(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp); -extern void dydx_model_steadystate(double *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx); -extern void sigmay_model_steadystate(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y); -extern void w_model_steadystate(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static); -extern void x0_model_steadystate(realtype *x0, const realtype t, const realtype *p, const realtype *k); -extern void xdot_model_steadystate(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); -extern void y_model_steadystate(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w); - -class Model_model_steadystate : public amici::Model_ODE { -public: - Model_model_steadystate() - : amici::Model_ODE( - amici::ModelDimensions( - 3, - 3, - 3, - 3, - 0, - 5, - 4, - 3, - 3, - 0, - 0, - 0, - 0, - 0, - 1, - 2, - 2, - 1, - 0, - 0, - {}, - 0, - 0, - 0, - 9, - 2, - 2 - ), - amici::SimulationParameters( - std::vector(4, 1.0), - std::vector(5, 1.0) - ), - amici::SecondOrderMode::none, - std::vector{0, 0, 0}, - std::vector{}) - {}; - - amici::Model* clone() const override { return new Model_model_steadystate(*this); }; - - std::string getAmiciCommit() const override { return "d69c026f8f8a89a13f1fa1307548f2b8f7045fe1"; }; - - void fJSparse(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override { - JSparse_model_steadystate(JSparse, t, x, p, k, h, w, dwdx); - } - - void fJrz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fJy(double *nllh, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - Jy_model_steadystate(nllh, iy, p, k, y, sigmay, my); - } - - void fJz(double *nllh, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJrzdsigma(double *dJrzdsigma, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJrzdz(double *dJrzdz, const int iz, const realtype *p, const realtype *k, const double *rz, const double *sigmaz) override { - } - - void fdJydsigma(double *dJydsigma, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydsigma_model_steadystate(dJydsigma, iy, p, k, y, sigmay, my); - } - - void fdJydy(double *dJydy, const int iy, const realtype *p, const realtype *k, const double *y, const double *sigmay, const double *my) override { - dJydy_model_steadystate(dJydy, iy, p, k, y, sigmay, my); - } - - void fdJzdsigma(double *dJzdsigma, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdJzdz(double *dJzdz, const int iz, const realtype *p, const realtype *k, const double *z, const double *sigmaz, const double *mz) override { - } - - void fdeltaqB(double *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdeltasx(double *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl) override { - } - - void fdeltax(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old) override { - } - - void fdeltaxB(double *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *xB) override { - } - - void fdrzdp(double *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdrzdx(double *drzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fdsigmaydp(double *dsigmaydp, const realtype t, const realtype *p, const realtype *k, const realtype *y, const int ip) override { - } - - void fdsigmazdp(double *dsigmazdp, const realtype t, const realtype *p, const realtype *k, const int ip) override { - } - - void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *stcl, const realtype *spl, const realtype *sspl, bool include_static) override { - dwdp_model_steadystate(dwdp, t, x, p, k, h, w, tcl, stcl, spl, sspl, include_static); - } - - void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl, const realtype *spl, bool include_static) override { - dwdx_model_steadystate(dwdx, t, x, p, k, h, w, tcl, spl, include_static); - } - - void fdxdotdp(realtype *dxdotdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - dxdotdp_model_steadystate(dxdotdp, t, x, p, k, h, ip, w, dwdp); - } - - void fdydp(double *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *dwdp) override { - } - - void fdydx(double *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(dydx, t, x, p, k, h, w, dwdx); - } - - void fdzdp(double *dzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override { - } - - void fdzdx(double *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override { - } - - void frz(double *rz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - - void fsigmay(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) override { - sigmay_model_steadystate(sigmay, t, p, k, y); - } - - void fsigmaz(double *sigmaz, const realtype t, const realtype *p, const realtype *k) override { - } - - void fsrz(double *srz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fstau(double *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *sx, const int ip, const int ie) override { - } - - void fsx0(realtype *sx0, const realtype t,const realtype *x0, const realtype *p, const realtype *k, const int ip) override { - } - - void fsz(double *sz, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *sx, const int ip) override { - } - - void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) override { - w_model_steadystate(w, t, x, p, k, h, tcl, spl, include_static); - } - - void fx0(realtype *x0, const realtype t, const realtype *p, const realtype *k) override { - x0_model_steadystate(x0, t, p, k); - } - - void fxdot(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - xdot_model_steadystate(xdot, t, x, p, k, h, w); - } - - void fy(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override { - y_model_steadystate(y, t, x, p, k, h, w); - } - - void fz(double *z, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override { - } - -}; - -} // namespace model_model_steadystate - -} // namespace amici - -#endif /* _amici_model_steadystate_h */ diff --git a/models/model_steadystate/rebuild_model_steadystate.m b/models/model_steadystate/rebuild_model_steadystate.m deleted file mode 100644 index f7a6f63e5d..0000000000 --- a/models/model_steadystate/rebuild_model_steadystate.m +++ /dev/null @@ -1,5 +0,0 @@ -function rebuild_model_steadystate() -modelName = 'model_steadystate'; -amimodel.compileAndLinkModel(modelName, '', [], [], [], []); -amimodel.generateMatlabWrapper(3, 3, 5, 4, 0, 0, [], ['simulate_' modelName '.m'], 'model_steadystate', 'log10', 1, 1); -end diff --git a/models/model_steadystate/sigmay.cpp b/models/model_steadystate/sigmay.cpp deleted file mode 100644 index d895acd6ca..0000000000 --- a/models/model_steadystate/sigmay.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void sigmay_model_steadystate(double *sigmay, const realtype t, const realtype *p, const realtype *k, const realtype *y) { - sigmay[0] = 1.0; - sigmay[1] = 1.0; - sigmay[2] = 1.0; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/swig/CMakeLists.txt b/models/model_steadystate/swig/CMakeLists.txt deleted file mode 100644 index 523571c52e..0000000000 --- a/models/model_steadystate/swig/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -cmake_policy(VERSION 3.15...3.27) - -# cmake >=3.27 -if(POLICY CMP0144) - cmake_policy(SET CMP0144 NEW) -endif(POLICY CMP0144) -# cmake >= 3.30 -if(POLICY CMP0167) - cmake_policy(SET CMP0167 NEW) -endif(POLICY CMP0167) - - -if(DEFINED ENV{SWIG}) - set(SWIG_EXECUTABLE $ENV{SWIG}) -endif() - -find_package(SWIG REQUIRED) -include(${SWIG_USE_FILE}) - -if(DEFINED ENV{PYTHON_EXECUTABLE}) - set(Python3_EXECUTABLE $ENV{PYTHON_EXECUTABLE}) -endif() -# We don't need "Interpreter" here, but without that, FindPython3 will -# ignore the Python version selected via $Python3_EXECUTABLE -find_package(Python3 COMPONENTS Interpreter Development) -include_directories(${Python3_INCLUDE_DIRS}) - -set(SWIG_LIBRARY_NAME _${PROJECT_NAME}) -set(CMAKE_SWIG_FLAGS "") -set_source_files_properties(${PROJECT_NAME}.i PROPERTIES CPLUSPLUS ON) - -# swig does not use INTERFACE_INCLUDE_DIRS of linked libraries, so add manually -get_target_property(AMICI_INCLUDE_DIRS Upstream::amici INTERFACE_INCLUDE_DIRECTORIES) -include_directories(${AMICI_INCLUDE_DIRS} .. ${AMICI_INCLUDE_DIRS}/../swig) - -swig_add_library(${SWIG_LIBRARY_NAME} - TYPE MODULE - LANGUAGE python - SOURCES ${PROJECT_NAME}.i) - - -set_target_properties(${SWIG_LIBRARY_NAME} - PROPERTIES - SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE - PREFIX "" -) - -# Python extension suffix -execute_process( - COMMAND ${Python3_EXECUTABLE} -c - "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" - OUTPUT_VARIABLE PY_EXT_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT "${PY_EXT_SUFFIX}" STREQUAL "") - message(STATUS "Python extension suffix is ${PY_EXT_SUFFIX}") - set_target_properties(${SWIG_LIBRARY_NAME} PROPERTIES SUFFIX "${PY_EXT_SUFFIX}" ) -endif() - - -swig_link_libraries(${SWIG_LIBRARY_NAME} - ${Python3_LIBRARIES} - model) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.py - $ DESTINATION .) - -# configure module setup script -set(SETUP_PY_IN ${Amici_DIR}/model_setup.template.py) -set(SETUP_PY_OUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py) - -add_custom_target(install-python - DEPENDS ${SWIG_LIBRARY_NAME} - COMMAND python ${SETUP_PY_OUT} install) diff --git a/models/model_steadystate/swig/model_steadystate.i b/models/model_steadystate/swig/model_steadystate.i deleted file mode 100644 index e96f7db31d..0000000000 --- a/models/model_steadystate/swig/model_steadystate.i +++ /dev/null @@ -1,22 +0,0 @@ -%module model_steadystate -%import amici.i -// Add necessary symbols to generated header - -%{ -#include "wrapfunctions.h" -#include "amici/model_ode.h" -#include "amici/model_dae.h" -using namespace amici; -%} - - -// Make model module accessible from the model -%feature("pythonappend") amici::generic_model::getModel %{ - if '.' in __name__: - import sys - val.module = sys.modules['.'.join(__name__.split('.')[:-1])] -%} - - -// Process symbols in header -%include "wrapfunctions.h" diff --git a/models/model_steadystate/w.cpp b/models/model_steadystate/w.cpp deleted file mode 100644 index 5a0acafc83..0000000000 --- a/models/model_steadystate/w.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void w_model_steadystate(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl, const realtype *spl, bool include_static) { - w[0] = p[3]*x[2]; - w[1] = x[0]*x[0]; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/wrapfunctions.cpp b/models/model_steadystate/wrapfunctions.cpp deleted file mode 100644 index a7a0f3cf9a..0000000000 --- a/models/model_steadystate/wrapfunctions.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "amici/model.h" -#include "wrapfunctions.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel() { - return std::unique_ptr( - new amici::model_model_steadystate::Model_model_steadystate()); -} - -} // namespace generic_model - -} // namespace amici - diff --git a/models/model_steadystate/wrapfunctions.h b/models/model_steadystate/wrapfunctions.h deleted file mode 100644 index 57011adfae..0000000000 --- a/models/model_steadystate/wrapfunctions.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _amici_wrapfunctions_h -#define _amici_wrapfunctions_h - -#include "model_steadystate.h" - -namespace amici { - -namespace generic_model { - -std::unique_ptr getModel(); - -} // namespace generic_model - -} // namespace amici - -#endif /* _amici_wrapfunctions_h */ diff --git a/models/model_steadystate/x0.cpp b/models/model_steadystate/x0.cpp deleted file mode 100644 index 1193148161..0000000000 --- a/models/model_steadystate/x0.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void x0_model_steadystate(realtype *x0, const realtype t, const realtype *p, const realtype *k) { - x0[0] = k[0]; - x0[1] = k[1]; - x0[2] = k[2]; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/xdot.cpp b/models/model_steadystate/xdot.cpp deleted file mode 100644 index 65b2ca396f..0000000000 --- a/models/model_steadystate/xdot.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void xdot_model_steadystate(realtype *xdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - xdot[0] = p[4]+w[0]-p[0]*w[1]*2.0+p[2]*x[1]*2.0-p[1]*x[0]*x[1]; - xdot[1] = w[0]+p[0]*w[1]-p[2]*x[1]-p[1]*x[0]*x[1]; - xdot[2] = -w[0]-k[3]*x[2]+p[1]*x[0]*x[1]; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/models/model_steadystate/y.cpp b/models/model_steadystate/y.cpp deleted file mode 100644 index 9b2ea9ad62..0000000000 --- a/models/model_steadystate/y.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "amici/symbolic_functions.h" -#include "amici/defines.h" //realtype definition -typedef amici::realtype realtype; -#include - -using namespace amici; - -namespace amici { - -namespace model_model_steadystate{ - -void y_model_steadystate(double *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) { - y[0] = x[0]; - y[1] = x[1]; - y[2] = x[2]; -} - -} // namespace model_model_steadystate - -} // namespace amici - diff --git a/python/tests/test_pregenerated_models.py b/python/tests/test_pregenerated_models.py index f9a6ccb5b6..0c03fa66a9 100755 --- a/python/tests/test_pregenerated_models.py +++ b/python/tests/test_pregenerated_models.py @@ -15,19 +15,10 @@ cpp_test_dir = Path(__file__).parents[2] / "tests" / "cpp" options_file = str(cpp_test_dir / "testOptions.h5") -# matlab-generated expected results -expected_results_file = str(cpp_test_dir / "expectedResults.h5") -expected_results_matlab = h5py.File(expected_results_file, "r") # python-generated expected results expected_results_file_py = str(cpp_test_dir / "expected_results_py.h5") expected_results_py = h5py.File(expected_results_file_py, "r") -model_cases = [ - (sub_test, case) - for sub_test in expected_results_matlab.keys() - for case in list(expected_results_matlab[sub_test].keys()) -] - model_cases_py = [ (sub_test, case) for sub_test in expected_results_py.keys() @@ -35,204 +26,6 @@ ] -@skip_on_valgrind -@pytest.mark.skipif( - os.environ.get("AMICI_SKIP_CMAKE_TESTS", "") == "TRUE", - reason="skipping cmake based test", -) -@pytest.mark.parametrize("sub_test,case", model_cases) -def test_pregenerated_model(sub_test, case): - """Tests models that were pregenerated using the matlab code - generation routines and cmake build routines. - - NOTE: requires having run `make python-tests` in /build/ before to build - the python modules for the test models. - """ - expected_results = expected_results_matlab - - if case.startswith("sensi2"): - model_name = sub_test + "_o2" - else: - model_name = sub_test - - model_swig_folder = str( - Path(__file__).parents[2] - / "build" - / "tests" - / "cpp" - / f"external_{model_name}-prefix" - / "src" - / f"external_{model_name}-build" - / "swig" - ) - - if not Path(model_swig_folder).exists(): - pytest.skip(f"Model {model_name} not found in {model_swig_folder}.") - - test_model_module = amici.import_model_module( - module_name=model_name, module_path=model_swig_folder - ) - model = test_model_module.getModel() - solver = model.getSolver() - amici.readModelDataFromHDF5( - options_file, model.get(), f"/{sub_test}/{case}/options" - ) - if model_name == "model_steadystate": - model.setSteadyStateComputationMode( - amici.SteadyStateComputationMode.integrateIfNewtonFails - ) - model.setSteadyStateSensitivityMode( - amici.SteadyStateSensitivityMode.integrateIfNewtonFails - ) - amici.readSolverSettingsFromHDF5( - options_file, solver.get(), f"/{sub_test}/{case}/options" - ) - - edata = None - if "data" in expected_results[sub_test][case].keys(): - edata = amici.readSimulationExpData( - str(expected_results_file), f"/{sub_test}/{case}/data", model.get() - ) - rdata = amici.runAmiciSimulation(model, solver, edata) - - check_derivative_opts = dict() - - if model_name == "model_nested_events": - check_derivative_opts["rtol"] = 1e-2 - elif model_name == "model_events": - check_derivative_opts["atol"] = 1e-3 - - if ( - edata - and solver.getSensitivityMethod() - and solver.getSensitivityOrder() - and len(model.getParameterList()) - and not model_name.startswith("model_neuron") - and not case.endswith("byhandpreeq") - ): - check_derivatives( - model, - solver, - edata, - **check_derivative_opts, - ) - - verify_simulation_opts = dict() - - if model_name.startswith("model_neuron"): - verify_simulation_opts["atol"] = 1e-5 - verify_simulation_opts["rtol"] = 1e-2 - - if ( - model_name.startswith("model_robertson") - and case == "sensiforwardSPBCG" - ): - verify_simulation_opts["atol"] = 1e-3 - verify_simulation_opts["rtol"] = 1e-3 - - verify_simulation_results( - rdata, - expected_results[sub_test][case]["results"], - **verify_simulation_opts, - ) - - if model_name == "model_steadystate" and case == "sensiforwarderrorint": - edata = amici.amici.ExpData(model.get()) - - # Test runAmiciSimulations: ensure running twice - # with same ExpData yields same results - if ( - edata - and model_name != "model_neuron_o2" - and not ( - model_name == "model_robertson" and case == "sensiforwardSPBCG" - ) - ): - if isinstance(edata, amici.amici.ExpData): - edatas = [edata, edata] - else: - edatas = [edata.get(), edata.get()] - - rdatas = amici.runAmiciSimulations( - model, solver, edatas, num_threads=2, failfast=False - ) - verify_simulation_results( - rdatas[0], - expected_results[sub_test][case]["results"], - **verify_simulation_opts, - ) - verify_simulation_results( - rdatas[1], - expected_results[sub_test][case]["results"], - **verify_simulation_opts, - ) - - # test residuals mode - if solver.getSensitivityMethod() == amici.SensitivityMethod.adjoint: - with pytest.raises(RuntimeError): - solver.setReturnDataReportingMode(amici.RDataReporting.residuals) - else: - solver.setReturnDataReportingMode(amici.RDataReporting.residuals) - rdata = amici.runAmiciSimulation(model, solver, edata) - verify_simulation_results( - rdata, - expected_results[sub_test][case]["results"], - fields=["t", "res", "sres", "y", "sy", "sigmay", "ssigmay"], - **verify_simulation_opts, - ) - with pytest.raises(RuntimeError): - solver.setSensitivityMethod(amici.SensitivityMethod.adjoint) - - chi2_ref = rdata.chi2 - - # test likelihood mode - solver.setReturnDataReportingMode(amici.RDataReporting.likelihood) - rdata = amici.runAmiciSimulation(model, solver, edata) - verify_simulation_results( - rdata, - expected_results[sub_test][case]["results"], - fields=["t", "llh", "sllh", "s2llh", "FIM"], - **verify_simulation_opts, - ) - - # test sigma residuals - - if ( - model_name == "model_jakstat_adjoint" - and solver.getSensitivityMethod() != amici.SensitivityMethod.adjoint - ): - model.setAddSigmaResiduals(True) - solver.setReturnDataReportingMode(amici.RDataReporting.full) - rdata = amici.runAmiciSimulation(model, solver, edata) - # check whether activation changes chi2 - assert chi2_ref != rdata.chi2 - - if ( - edata - and solver.getSensitivityMethod() - and solver.getSensitivityOrder() - and len(model.getParameterList()) - ): - check_derivatives(model, solver, edata, **check_derivative_opts) - - chi2_ref = rdata.chi2 - res_ref = rdata.res - - model.setMinimumSigmaResiduals(100) - rdata = amici.runAmiciSimulation(model, solver, edata) - # check whether changing the minimum changes res but not chi2 - assert np.isclose(chi2_ref, rdata.chi2) - assert not np.allclose(res_ref, rdata.res) - - model.setMinimumSigmaResiduals(-10) - rdata = amici.runAmiciSimulation(model, solver, edata) - # check whether having a bad minimum results in nan chi2 - assert np.isnan(rdata.chi2) - - with pytest.raises(RuntimeError): - model.getParameterByName("thisParameterDoesNotExist") - - @skip_on_valgrind @pytest.mark.skipif( os.environ.get("AMICI_SKIP_CMAKE_TESTS", "") == "TRUE", @@ -287,7 +80,9 @@ def test_pregenerated_model_py(sub_test, case): edata = None if "data" in expected_results[sub_test][case].keys(): edata = amici.readSimulationExpData( - str(expected_results_file), f"/{sub_test}/{case}/data", model.get() + str(expected_results_file_py), + f"/{sub_test}/{case}/data", + model.get(), ) rdata = amici.runAmiciSimulation(model, solver, edata) diff --git a/tests/cpp/CMakeLists.txt b/tests/cpp/CMakeLists.txt index 584384ce97..58a1c8e586 100644 --- a/tests/cpp/CMakeLists.txt +++ b/tests/cpp/CMakeLists.txt @@ -45,25 +45,6 @@ add_custom_target( # models depend on Upstream::amici add_library(Upstream::amici ALIAS amici) -# Amici testing library -add_library(amici-testing testfunctions.cpp) -target_compile_definitions( - amici-testing - PUBLIC NEW_OPTION_FILE="${CMAKE_CURRENT_SOURCE_DIR}/testOptions.h5" - PUBLIC HDFFILE="${CMAKE_CURRENT_SOURCE_DIR}/expectedResults.h5" - PUBLIC HDFFILEWRITE="${CMAKE_CURRENT_SOURCE_DIR}/writeResults.h5") -target_include_directories(amici-testing PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries( - amici-testing - PUBLIC Upstream::amici - PUBLIC gtest_main) - -# Names of models for which tests are to be run -set(TEST_MODELS - jakstat_adjoint_o2 - neuron_o2 - ) - if(ENABLE_SWIG AND ENABLE_PYTHON) add_custom_target( python-tests @@ -76,7 +57,6 @@ add_subdirectory(unittests) include(ExternalProject) - # Amici testing library add_library(amici-testing-py testfunctions.cpp) target_compile_definitions( @@ -91,6 +71,7 @@ target_link_libraries( PUBLIC gtest_main) +# Names of models for which tests are to be run set(PY_TEST_MODELS dirac_py @@ -143,42 +124,3 @@ foreach(MODEL IN ITEMS ${PY_TEST_MODELS}) add_dependencies(python-tests external_model_${MODEL}) endif() endforeach() - - -foreach(MODEL IN ITEMS ${TEST_MODELS}) - # Build model - string( - CONCAT MODEL_LIBRARY_DIR - "${CMAKE_CURRENT_BINARY_DIR}/external_model_${MODEL}-prefix/src/" - "external_model_${MODEL}-build/") - string( - CONCAT MODEL_LIBRARY - "${MODEL_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}model_${MODEL}" - "${CMAKE_STATIC_LIBRARY_SUFFIX}") - ExternalProject_Add( - external_model_${MODEL} - PREFIX "" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/models/model_${MODEL}/" - INSTALL_COMMAND "" - TEST_COMMAND "" - BUILD_ALWAYS 1 - DEPENDS amici - CMAKE_ARGS "-DCMAKE_BUILD_TYPE=Debug" - BUILD_BYPRODUCTS "${MODEL_LIBRARY}") - # Rebuild if amici files are updated - ExternalProject_Add_StepDependencies(external_model_${MODEL} build amici) - - add_library(model_${MODEL} STATIC IMPORTED) - add_dependencies(model_${MODEL} external_model_${MODEL}) - - set_target_properties( - model_${MODEL} - PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${CMAKE_SOURCE_DIR}/models/model_${MODEL}/" IMPORTED_LOCATION - "${MODEL_LIBRARY}") - # Build tests for this model - add_subdirectory(${MODEL}) - if(TARGET python-tests) - add_dependencies(python-tests external_model_${MODEL}) - endif() -endforeach() diff --git a/tests/cpp/expectedResults.h5 b/tests/cpp/expectedResults.h5 deleted file mode 100644 index c87ab70dcc..0000000000 Binary files a/tests/cpp/expectedResults.h5 and /dev/null differ