mrgsolve
Loading...
Searching...
No Matches
odeproblem Class Reference

#include <odeproblem.h>

Public Member Functions

 odeproblem (Rcpp::List param, Rcpp::NumericVector init, Rcpp::List funs, int n_capture_)
 ~odeproblem ()
void do_init_calc (bool answer)
void advance (double tfrom, double tto, LSODA &solver)
void call_derivs (double *t, double *y, double *ydot)
void init (int pos, double value)
double init (int pos)
void init_call (const double &time)
void init_call_record (const double &time)
void init_derivs (double time)
void y_init (int pos, double value)
void y_init (Rcpp::NumericVector init)
void y_add (const unsigned int pos, const double &value)
 add value to compartment pos
void table_call ()
 Call $TABLE function.
void table_init_call ()
void event_call ()
 Call $EVENT function.
void config_call ()
 Call $PREAMBLE function.
void set_d (rec_ptr this_rec)
void omega (const Rcpp::S4 &mod)
void sigma (const Rcpp::S4 &mod)
void copy_sigma_diagonals ()
arma::mat mv_omega (int n)
arma::mat mv_sigma (int n)
void pass_envir (Rcpp::Environment *x)
bool CFONSTOP ()
const std::vector< double > & param ()
void param (int pos, double value)
void check_data_rate (rec_ptr rec, int cmtn)
void check_modeled_dur (rec_ptr rec)
void check_modeled_rate (rec_ptr rec)
void rate (unsigned int pos, double value)
double rate (unsigned int pos)
 Get the modeled infusion rate from $MAIN.
void rate0 (unsigned int pos, double value)
double rate0 (unsigned int pos)
 Get the functioning infusion rate.
int rate_count (unsigned int pos)
void rate_add (unsigned int pos, const double &value)
void rate_rm (unsigned int pos, const double &value)
void rate_bump (const unsigned int pos, const double &value)
void rate_main (rec_ptr rec, int cmtn)
void rate_reset ()
 Reset all infusion rates.
void dur (unsigned int pos, double value)
double dur (unsigned int pos)
 Get the modeled infusion duration from $MAIN.
void reset_newid (const double id_)
 Reset odeproblem object for new individual.
void eta (int pos, double value)
void eps (int pos, double value)
unsigned short int systemoff ()
void on (unsigned short int cmt)
void off (unsigned short int cmt)
int is_on (unsigned int eq_n)
void fbio (unsigned int pos, double value)
double fbio (unsigned int pos)
 Get the bioavailability from $MAIN.
double alag (int cmt)
 Get the lag time from $MAIN.
void time (double time_)
void newind (unsigned int newind_)
unsigned int newind ()
void advan (int x)
int advan ()
void advan2 (const double &tfrom, const double &tto)
void advan4 (const double &tfrom, const double &tto)
void advan11 (const double &tfrom, const double &tto)
void set_eta ()
 set number of ETAs in the model
void set_eps ()
 set number of EPSs in the model
int neta ()
int neps ()
void nid (int n)
 sets the number of IDs
void idn (int n)
 sets the current ID number
void nrow (int n)
 sets the number of data set rows
void rown (int n)
 sets the current data set row number
void inrow (int n)
 sets number of output rows for current ID
void irown (int n)
 sets the output row number for current ID
dvec & get_capture ()
double capture (int i)
void copy_parin (const Rcpp::List &parin, const Rcpp::S4 &mod)
 copies items passed in through parin into the odeproblem object
void copy_funs (const Rcpp::List &funs)
bool any_mtime ()
std::vector< mrgsolve::evdata > mtimes ()
void clear_mtime ()
void y (const int pos, const double value)
double y (const int pos)
int istate ()
void istate (int value)
void lsoda_init ()
int npar ()
 returns the number of parameters
int neq ()
 returns the number of state variables
void tol (double atol, double rtol)
 sets the absolute and relative tolerances

Public Attributes

std::vector< double > Y
 compartment amounts
std::vector< double > Ydot
 dxdt values
std::vector< double > Yout
 used to hold Y values during solving
std::vector< double > Param
 parameter vector
std::vector< double > Capture
 captured data items
double Atol
 absolute tolerance used by ODE solver
double Rtol
 relative tolerance used by ODE solver
double ssAtol
 absolute tolerance when finding steady state
double ssRtol
int Npar
 number of parameters
int Neq
 number of equations
int Istate
 istate value
bool ss_fixed
 If true, then no warning is issued if SS not reached in ss_n doses.
int ss_n
 Max number of doses during SS advance before warning is issued.
bool ss_flag
 flag indicating when the system is advancing to SS
bool system_at_ss
 flag indicating the system was advanced to SS
std::vector< int > Ss_cmt
 vector of compartments to consider for SS
bool check_modeled_infusions
std::vector< double > R0
 acutal current infusion rate
std::vector< unsigned int > infusion_count
 number of active infusions
std::vector< double > R
 receive user input for infusion rate
std::vector< double > D
 receive user input for infusion duration
std::vector< double > Init_value
 initial conditions
std::vector< double > Init_dummy
 initial conditions for user input
std::vector< double > F
 bioavability
std::vector< double > Alag
 dosing lag time
std::vector< int > On
 compartment on/off indicator
databox d
 various data passed to model functions
int Advan
 simulation mode: 1/2/3/4 (PK models) or 13 (odes)
std::vector< double > a
 used for advan 1/2/3/4 calculations
std::vector< double > alpha
 used for advan 1/2/3/4 calculation
mrgsolve::resim simeta
 functor for resimulating etas
mrgsolve::resim simeps
 functor for resimulating epsilons
arma::mat Omega
 variance/covariance matrix for between-subject variability
arma::mat Sigma
 variance/covariance matrix for within-subject variability
std::vector< double > pred
 brings clearances, volumes, and & for advan 1/2/3/4
deriv_func Derivs
 $ODE function
init_func Inits
 $MAIN function
table_func Table
 $TABLE function
event_func Event
 $EVENT function
config_func Config
 $PREAMBLE function
bool Do_Init_Calc
 Flag regulating whether or not initials are taken from $MAIN.
int interrupt
 Check User Interrupt interval (number of simulation records).

Constructor & Destructor Documentation

◆ odeproblem()

odeproblem::odeproblem ( Rcpp::List param,
Rcpp::NumericVector init,
Rcpp::List funs,
int n_capture_ )

◆ ~odeproblem()

odeproblem::~odeproblem ( )
inline

Member Function Documentation

◆ advan() [1/2]

int odeproblem::advan ( )
inline

◆ advan() [2/2]

void odeproblem::advan ( int x)

◆ advan11()

void odeproblem::advan11 ( const double & tfrom,
const double & tto )

◆ advan2()

void odeproblem::advan2 ( const double & tfrom,
const double & tto )

◆ advan4()

void odeproblem::advan4 ( const double & tfrom,
const double & tto )

◆ advance()

void odeproblem::advance ( double tfrom,
double tto,
LSODA & solver )

◆ alag()

double odeproblem::alag ( int cmt)

Get the lag time from $MAIN.

◆ any_mtime()

bool odeproblem::any_mtime ( )
inline

◆ call_derivs()

void odeproblem::call_derivs ( double * t,
double * y,
double * ydot )

◆ capture()

double odeproblem::capture ( int i)
inline

◆ CFONSTOP()

bool odeproblem::CFONSTOP ( )
inline

◆ check_data_rate()

void odeproblem::check_data_rate ( rec_ptr rec,
int cmtn )

◆ check_modeled_dur()

void odeproblem::check_modeled_dur ( rec_ptr rec)

◆ check_modeled_rate()

void odeproblem::check_modeled_rate ( rec_ptr rec)

◆ clear_mtime()

void odeproblem::clear_mtime ( )
inline

◆ config_call()

void odeproblem::config_call ( )

Call $PREAMBLE function.

◆ copy_funs()

void odeproblem::copy_funs ( const Rcpp::List & funs)

◆ copy_parin()

void odeproblem::copy_parin ( const Rcpp::List & parin,
const Rcpp::S4 & mod )

copies items passed in through parin into the odeproblem object

◆ copy_sigma_diagonals()

void odeproblem::copy_sigma_diagonals ( )

◆ do_init_calc()

void odeproblem::do_init_calc ( bool answer)
inline

◆ dur() [1/2]

double odeproblem::dur ( unsigned int pos)

Get the modeled infusion duration from $MAIN.

◆ dur() [2/2]

void odeproblem::dur ( unsigned int pos,
double value )
inline

◆ eps()

void odeproblem::eps ( int pos,
double value )
inline

◆ eta()

void odeproblem::eta ( int pos,
double value )
inline

◆ event_call()

void odeproblem::event_call ( )

Call $EVENT function.

◆ fbio() [1/2]

double odeproblem::fbio ( unsigned int pos)

Get the bioavailability from $MAIN.

◆ fbio() [2/2]

void odeproblem::fbio ( unsigned int pos,
double value )
inline

◆ get_capture()

dvec & odeproblem::get_capture ( )
inline

◆ idn()

void odeproblem::idn ( int n)
inline

sets the current ID number

◆ init() [1/2]

double odeproblem::init ( int pos)
inline

◆ init() [2/2]

void odeproblem::init ( int pos,
double value )
inline

◆ init_call()

void odeproblem::init_call ( const double & time)

Call $MAIN to get the initial conditions.

Parameters
timethe time to assume for the calculation

◆ init_call_record()

void odeproblem::init_call_record ( const double & time)

Call $MAIN with the dummy initial condition vector.

Parameters
timethe time to assume when making the call.

◆ init_derivs()

void odeproblem::init_derivs ( double time)

◆ inrow()

void odeproblem::inrow ( int n)
inline

sets number of output rows for current ID

◆ irown()

void odeproblem::irown ( int n)
inline

sets the output row number for current ID

◆ is_on()

int odeproblem::is_on ( unsigned int eq_n)
inline

◆ istate() [1/2]

int odeproblem::istate ( )
inline

◆ istate() [2/2]

void odeproblem::istate ( int value)
inline

◆ lsoda_init()

void odeproblem::lsoda_init ( )
inline

◆ mtimes()

std::vector< mrgsolve::evdata > odeproblem::mtimes ( )
inline

◆ mv_omega()

arma::mat odeproblem::mv_omega ( int n)

◆ mv_sigma()

arma::mat odeproblem::mv_sigma ( int n)

◆ neps()

int odeproblem::neps ( )
inline

◆ neq()

int odeproblem::neq ( )
inline

returns the number of state variables

◆ neta()

int odeproblem::neta ( )
inline

◆ newind() [1/2]

unsigned int odeproblem::newind ( )
inline

◆ newind() [2/2]

void odeproblem::newind ( unsigned int newind_)
inline

◆ nid()

void odeproblem::nid ( int n)
inline

sets the number of IDs

◆ npar()

int odeproblem::npar ( )
inline

returns the number of parameters

◆ nrow()

void odeproblem::nrow ( int n)
inline

sets the number of data set rows

◆ off()

void odeproblem::off ( unsigned short int cmt)

◆ omega()

void odeproblem::omega ( const Rcpp::S4 & mod)

◆ on()

void odeproblem::on ( unsigned short int cmt)

◆ param() [1/2]

const std::vector< double > & odeproblem::param ( )
inline

◆ param() [2/2]

void odeproblem::param ( int pos,
double value )
inline

◆ pass_envir()

void odeproblem::pass_envir ( Rcpp::Environment * x)
inline

◆ rate() [1/2]

double odeproblem::rate ( unsigned int pos)

Get the modeled infusion rate from $MAIN.

◆ rate() [2/2]

void odeproblem::rate ( unsigned int pos,
double value )
inline

◆ rate0() [1/2]

double odeproblem::rate0 ( unsigned int pos)

Get the functioning infusion rate.

◆ rate0() [2/2]

void odeproblem::rate0 ( unsigned int pos,
double value )
inline

◆ rate_add()

void odeproblem::rate_add ( unsigned int pos,
const double & value )

◆ rate_bump()

void odeproblem::rate_bump ( const unsigned int pos,
const double & value )

◆ rate_count()

int odeproblem::rate_count ( unsigned int pos)
inline

◆ rate_main()

void odeproblem::rate_main ( rec_ptr rec,
int cmtn )

◆ rate_reset()

void odeproblem::rate_reset ( )

Reset all infusion rates.

◆ rate_rm()

void odeproblem::rate_rm ( unsigned int pos,
const double & value )

◆ reset_newid()

void odeproblem::reset_newid ( const double id_)

Reset odeproblem object for new individual.

◆ rown()

void odeproblem::rown ( int n)
inline

sets the current data set row number

◆ set_d()

void odeproblem::set_d ( rec_ptr this_rec)

◆ set_eps()

void odeproblem::set_eps ( )

set number of EPSs in the model

◆ set_eta()

void odeproblem::set_eta ( )

set number of ETAs in the model

◆ sigma()

void odeproblem::sigma ( const Rcpp::S4 & mod)

◆ systemoff()

unsigned short int odeproblem::systemoff ( )
inline

◆ table_call()

void odeproblem::table_call ( )

Call $TABLE function.

◆ table_init_call()

void odeproblem::table_init_call ( )

◆ time()

void odeproblem::time ( double time_)
inline

◆ tol()

void odeproblem::tol ( double atol,
double rtol )

sets the absolute and relative tolerances

◆ y() [1/2]

double odeproblem::y ( const int pos)
inline

◆ y() [2/2]

void odeproblem::y ( const int pos,
const double value )
inline

◆ y_add()

void odeproblem::y_add ( const unsigned int pos,
const double & value )

add value to compartment pos

◆ y_init() [1/2]

void odeproblem::y_init ( int pos,
double value )

Assigns values to both the compartment and the vector of initial conditions.

Parameters
posthe compartment number (C++ indexing)
valuethe value for the compartment

◆ y_init() [2/2]

void odeproblem::y_init ( Rcpp::NumericVector init)

Member Data Documentation

◆ a

std::vector<double> odeproblem::a

used for advan 1/2/3/4 calculations

◆ Advan

int odeproblem::Advan

simulation mode: 1/2/3/4 (PK models) or 13 (odes)

◆ Alag

std::vector<double> odeproblem::Alag

dosing lag time

◆ alpha

std::vector<double> odeproblem::alpha

used for advan 1/2/3/4 calculation

◆ Atol

double odeproblem::Atol

absolute tolerance used by ODE solver

◆ Capture

std::vector<double> odeproblem::Capture

captured data items

◆ check_modeled_infusions

bool odeproblem::check_modeled_infusions

◆ Config

config_func odeproblem::Config

$PREAMBLE function

◆ D

std::vector<double> odeproblem::D

receive user input for infusion duration

◆ d

databox odeproblem::d

various data passed to model functions

◆ Derivs

deriv_func odeproblem::Derivs

$ODE function

◆ Do_Init_Calc

bool odeproblem::Do_Init_Calc

Flag regulating whether or not initials are taken from $MAIN.

◆ Event

event_func odeproblem::Event

$EVENT function

◆ F

std::vector<double> odeproblem::F

bioavability

◆ infusion_count

std::vector<unsigned int> odeproblem::infusion_count

number of active infusions

◆ Init_dummy

std::vector<double> odeproblem::Init_dummy

initial conditions for user input

◆ Init_value

std::vector<double> odeproblem::Init_value

initial conditions

◆ Inits

init_func odeproblem::Inits

$MAIN function

◆ interrupt

int odeproblem::interrupt

Check User Interrupt interval (number of simulation records).

◆ Istate

int odeproblem::Istate

istate value

◆ Neq

int odeproblem::Neq

number of equations

◆ Npar

int odeproblem::Npar

number of parameters

◆ Omega

arma::mat odeproblem::Omega

variance/covariance matrix for between-subject variability

◆ On

std::vector<int> odeproblem::On

compartment on/off indicator

◆ Param

std::vector<double> odeproblem::Param

parameter vector

◆ pred

std::vector<double> odeproblem::pred

brings clearances, volumes, and & for advan 1/2/3/4

◆ R

std::vector<double> odeproblem::R

receive user input for infusion rate

◆ R0

std::vector<double> odeproblem::R0

acutal current infusion rate

◆ Rtol

double odeproblem::Rtol

relative tolerance used by ODE solver

◆ Sigma

arma::mat odeproblem::Sigma

variance/covariance matrix for within-subject variability

◆ simeps

mrgsolve::resim odeproblem::simeps

functor for resimulating epsilons

◆ simeta

mrgsolve::resim odeproblem::simeta

functor for resimulating etas

◆ Ss_cmt

std::vector<int> odeproblem::Ss_cmt

vector of compartments to consider for SS

◆ ss_fixed

bool odeproblem::ss_fixed

If true, then no warning is issued if SS not reached in ss_n doses.

◆ ss_flag

bool odeproblem::ss_flag

flag indicating when the system is advancing to SS

◆ ss_n

int odeproblem::ss_n

Max number of doses during SS advance before warning is issued.

◆ ssAtol

double odeproblem::ssAtol

absolute tolerance when finding steady state

◆ ssRtol

double odeproblem::ssRtol

◆ system_at_ss

bool odeproblem::system_at_ss

flag indicating the system was advanced to SS

◆ Table

table_func odeproblem::Table

$TABLE function

◆ Y

std::vector<double> odeproblem::Y

compartment amounts

◆ Ydot

std::vector<double> odeproblem::Ydot

dxdt values

◆ Yout

std::vector<double> odeproblem::Yout

used to hold Y values during solving


The documentation for this class was generated from the following files: