DESCRIPTION:
PKPD model. The PK data must be tagged with the lowest OBSERVATION ID value. 
The administration is extravascular with a first order absorption (rate constant ka) and a lag time (Tlag).
The PK model has one compartment (volume V) and a linear elimination (clearance Cl).
The PD model is an indirect turnover model with inhibition of the production (baseline response R0, degradation rate kout, 
maximal fraction of inhibition Imax, and half-maximal inhibitory concentration IC50).

[LONGITUDINAL]
input = {Tlag, ka, V, Cl, R0, W11,W12,W13,W14,W15,b11,b12,b13,b14,b15,W21,W22,W23,W24,W25,b21,kout}

PK:
;====== PK part of the model

; PK model definition 
Cc = pkmodel(Tlag, ka, V, Cl)

EQUATION:
;====== PD part of the model

kin = kout * R0

; Initial values
R_0 = R0
                               
; Parameter transformation

h1 = max(0, W11 * Cc + b11)
h2 = max(0, W12 * Cc + b12)
h3 = max(0, W13 * Cc + b13)
h4 = max(0, W14 * Cc + b14)
h5 = max(0, W15 * Cc + b15)

fNN =  min(W21 * h1 + W22 * h2 + W23 * h3 + W24 * h4 + W25 * h5 + b21, 1)
                               
; ODE for the response
ddt_R = kin * (1 - fNN) - kout * R

OUTPUT: 
output = {Cc, R}