///////////////////////////////////////////////////////////////////////////////////////////////
//
// Table of controllers
//
// format:
// -------
// ControlledVarName	ControllerVarName	ControllerType		Gain
//		FractionalRatePerMinute		Constant		Comment
//
// Items in the table are space / comma / tab separated values.
// variable names can be long or abbreviated.
//
// Controller Type is currently one of:
//   ERROR_GAIN_UNLIMITED (EGU) Var1.value --> Var1.initial + Gain *
//                                                    (Var2.value - Var2.initial) + Constant
//   ERROR_GAIN_LIMITED (EGL)   Var1.value --> Var1.limits( Var1.initial + Gain *
//                                                    (Var2.value - Var2.initial) + Constant
//   PROPORTION_LIMITED (PRL)   Var1.value --> Var1.initial * (1 + Gain *
//                                                    (Var2.value/Var2.initial - 1) + Constant
//   ERROR_POWER_LIMITED	(E^L)  Var1.value --> var1.limits( Var1.initial + Constant *
//                                                    (Var2.value - Var2.initial) ^ Gain)
//   ERROR_POSITIVE_LIMITED	(EPL)
//
// Gain     is the multiplier for errors; this will obviously depend on the units
//          in which the variables are measured.
//
// Constant is the value that is added on to errors as a bias.
//
// Rate     is expressed as the fraction of the total correction which is
//          achieved in one minute.
//
// Comment  must be enclosed in inverted commas.
//
// Two controllers with the same controlled-variable (Var1) and the same rate
// will be 'coupled' - i.e. their error values will be summed in order
// to calculate a target value. They must also have exactly the same rate
// constant for them to work together. If you need two controllers with different
// rates, the slower one should be entered first, so that it does not interfere
// 'over' the effects of the faster one.
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// var1	var2	type	gain	rate	const	comment
//

//HR	ITP	EGL	-0.2	0.99	0	"Respiratory cycle affects venous return"
HR	CVS.APL	EPPL	2	0.8	-4E5	"Baroreflex tachycardia"
HR	Symp	EGL	200	0.8	0	"Other CNS sympathetic reflexes, e.g. cerebral hypoxia, fear"
HR BETA_ADRENOCEPTOR EGL 2000	0.8	0	"Drug-mediated tachycardia"
HR	Temp	EGL	5	0.8	0	"Direct temperature effect on sinus node"
//VenC	APCO2	EGL	-100000	0.8	0	"Exercise-induced venous return"
VenC	Exer	EGL	10	0.8	0	"Exercise-induced venous return"


Symp	Consc	EGL	5	0.05	0	"Sympathetic tone falls with conscious level"
Symp	Hypox	EGL	20	0.95	0	"Hypoxia-driven sympathetics"
Symp	Pain	EGL	1	0.95	0	"Sympathetic response to pain"
Symp	Exer	EGL	5E-5	0.95	0	"Sympathetic exercise response"
Symp	CVS.APL	EPL	-20	0.95	0	"Baroreflex sympathetics"
Symp	Glu	EPL	-100	0.95	-0.200	"Sympathetic response to hypoglycaemia"

VCT	CVS.AP	EGU	-2	0.3	0	"Baroreflex vasoconstriction"
VCT	Symp	EGU	0.05	0.3	0	"Sympathetic vasoconstriction"
//VCT	AngII	PRL	0.100	0.3	0	"Angiotensin mediated vasoconstriction"
VCT ALPHA_ADRENOCEPTOR EGU 3	0.3	0	"Drug-mediated vasoconstriction"
VCT	ACO2	ENL	-0.1	0.3	0	"Carbon dioxide vasodilation"

ViRes	VCT	EGL	1.5	0.8	0	"Vasoconstriction in gut"
BrRes	BrO2	EGL	3.0	0.1	0	"Cerebral autoregulation"
ReRes	AngII	EGL	1E12	0.01	0	"Renal autoregulation by Angiotensin II"

Aldo	PK	EGL	2E-6	0.1	0	"Aldosterone secreted in response to hyperkalaemia"
AngII	BV	EGL	-4E-12  0.05	0	"Angiotensin II production depends on blood volume"
AngII	PNa	EPL	-5E-10  0.05	-3.5E10	"Angiotensin II production depends on plasma sodium"
ADH	POsm	EGL	3E-10	0.01	0	"Hypothalamic osmoreceptors control posterior pituitary"
ADH	RAP	EPL	-1E-7	0.01	-1E-10	"Atrial stretch inhibits ADH"

O2Drv	APO2	EPL	-30	0.9	0	"Low arterial pO2 increases respiratory drive"
O2Drv	AO2	PRL	-0.1	0.9	0	"Low arterial O2 content increases respiratory drive"
O2Drv	BrO2	EPL	-1	0.9	0	"Brain hypoxia increases respiratory drive"
//CO2Drv
pHDrv	pH	EGL	-10	1	0	"Acidosis increases respiratory drive"
TidV	RespDr	EGL	0.51	1	0	"Respiratory drive controls tidal volume"

SkRes	SkTmp	EGL	-.0125	0.4	0	"Skin vasodilation to heat sensation"
//Skres VCT was 0.1, but need fright effect
SkRes	VCT	EGL	6	0.4	0	"Reflex and drug-mediated vasoconstriction"
SkRes	Temp	EGL	-.125	0.4	0	"Skin vasodilation to high body temperature"
SkRes	Fever	EPWL	4	0.4	0	"Fever causes vasoconstriction intially"
SkRes	APCO2	ENL	-5	0.2	0	"Carbon dioxide retention causes skin vasodilation"
Fever INFLAMMATORY_ACTIVITY EGL 1E4 0.2	0	"Inflammatory cytokines cause fever"

//SwR	Temp	EGL	0.01	1	0	"Sweating in response to fever"
PVR	SPAP	EGL	-0.1	0.3	0	"Pulmonary autoregulation"

Eryth	AO2	EGL	-20	0.003	0	"Erythropoietin secreted in hypoxia"
RCM	Eryth	EGL	10	0.0001	0	"Red cells produced in response to erythropoietin"
LVH	APL	EPL	10	1E-6    0       "Ventricular hypertrophy in hypertension"

Thyr	Temp	EGL	-0.03	1E-6	0	"Thyroxine governed by long term body temperature"
