1 #include <../../nrnconf.h> 39 neqn += (*m) -> extra_eqn_count();
58 (*m) -> alloc(neqn + 1);
59 neqn += (*m) -> extra_eqn_count();
67 hoc_execerror(
"NrnDAEs only work with secondorder==0 or daspk",0);
88 (*m) -> dkmap(pv, pvdot);
96 (*m) -> dkres(y, yprime, delta);
136 Node**
const nodes,
Vect*
const elayer,
void (*f_init)(
void*
data),
void*
const data)
142 const int size =
y_.size();
149 Vect &elay = *elayer;
282 delta[
bmap_[
i] - 1] -= (*cyp)[
i];
void init()
Initialize the dynamics.
void dkres(double *y, double *yprime, double *delta)
Compute the residual: .
void nrndae_register(NrnDAE *n)
Add a NrnDAE object to the system.
void alloc(int start_index)
Allocate space for these dynamics in the overall system.
Vect yptmp_
temporary vector used for residual calculation.
int nrndae_extra_eqn_count()
Vect & y_
vector to store the state variables in
int nrndae_list_is_empty()
Represent main neuron object computed by single thread.
void v2y()
Transfer any voltage states to y_.
static void update(NrnThread *)
NrnDAEPtrList::const_iterator NrnDAEPtrListIterator
void nrn_thread_error(const char *)
void rhs()
Compute the right side portion of .
Node ** nodes_
Pointers to voltage nodes used by the dynamics.
virtual ~NrnDAE()
Destructor.
Supports modifying voltage equations and adding new equations.
void dkmap(double **pv, double **pvdot)
Setup the map between voltages and states in y_.
void alloc(int, int, Node **, int *)
int extra_eqn_count()
Find the number of state variables introduced by this object.
int const size_t const size_t n
virtual void alloc_(int size, int start, int nnode, Node **nodes, int *elayer)
Additional allocation for subclasses.
Memb_list * _ecell_memb_list
void * data_
Data to pass to f_init_.
static NrnDAEPtrList nrndae_list
std::list< NrnDAE * > NrnDAEPtrList
virtual void f_(Vect &y, Vect &yprime, int size)=0
The right-hand-side function.
void nrn_matrix_node_free()
virtual double jacobian_multiplier_()
int nnode_
Number of voltage nodes used by the dynamics.
int * bmap_
mapping between the states in y and the states in the whole system
void hoc_execerror(const char *, const char *)
void update()
Update states to reflect the changes over a time-step.
Vect * y0_
vector of initial conditions
void nrndae_dkmap(double **, double **)
NrnDAE(Matrix *cmat, Vect *const yvec, Vect *const y0, int nnode, Node **const nodes, Vect *const elayer, void(*f_init)(void *data)=NULL, void *const data=NULL)
Constructor.
NEURON Differential Algebraic Equations.
void nrndae_dkpsol(double)
int start_
the position of the first added equation (if any) in the global system
Vect cyp_
temporary vector used for residual calculation.
int * elayer_
Which voltage layers to read from.
void nrndae_deregister(NrnDAE *n)
Remove a NrnDAE object from the system.
void nrndae_dkres(double *, double *, double *)
virtual MatrixMap * jacobian_(Vect &y)=0
Compute the Jacobian.
Matrix * assumed_identity_
identity matrix if constructed with NULL; else NULL.
void mulv(Vect &in, Vect &out)
void(* f_init_)(void *data)
Function used for initializing the state variables.
void lhs()
Compute the left side portion of .
int size_
total number of states declared or modified in this object