Personal tools
 

heart10Doc.h

Click here to get the file

Size 11.8 kB - File type text/plain

File contents

// heart10Doc.h : interface of the CHeart10Doc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_HEART10DOC_H__404AF2EC_AC93_11D3_8BDF_00C026DD6028__INCLUDED_)
#define AFX_HEART10DOC_H__404AF2EC_AC93_11D3_8BDF_00C026DD6028__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define  NOP  12
const float R=8.3143f;
const float T=310.15f;
const float F=96.4867f;         //Coulomb/mM

const float Elementarycharge=1.602E-19;
const int gatstep=1;
const int powerghk=1000;

class CHeart10Doc : public CDocument
{
protected: // create from serialization only
	CHeart10Doc();
	DECLARE_DYNCREATE(CHeart10Doc)

// Attributes
public:	

// Operations
public:
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CHeart10Doc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL

// Implementation
public:
	float	Pulse[19];	//Pulse Parameter Array
	/////-------------------- Pulse Parameters ------------------------------------------------------/////
	//	0:holding potential, 1:holding length, 2:pulse I start, 3:pulse I final, 4:pulse I length 	 /////
	//	5:PII start, 6:PII final, 7:PII length, 8:PIII start, 9:PIII final, 10:PIII length			 /////	
	//	11:return potential, 12:return length, 13:step(mV) increment, 14:Duration Increment			 ///// 
	//	15:Episode number, 16:Episode interval (sec), 17:Stimulus Number			 /////	
	//	18:stimulus interval (sec), m_TotalTime=Pulse[18]*Pulse[17]									 ///// 
	
	
	float	SF[25];		//Scale Factor Array
	/////-------------------- Scale Factor Parameters -----------------------------------------------/////
	//	3:Inward Rectifier K channel, 4:Na channel, 5:IKr channel, 6:Transient Outward K,		 	 /////
	//	7:Sustained Outward K channel, 8:L-type Ca channel, 9:T-type Ca channe						 /////	
	//	10:Slow Delayed Rectifier K, 11:Hyperpolarized Activated channel, 12:KACh channel			 ///// 
	//	18: K background,19:Stretch-Activated Channel, 20:Nonselective Cation Channel, 21:Na-Ca exchanger	/////	
	//	22:Na-K pump, 23:Cell Capacitance Factor													 ///// 
	float SF_Arel, SF_Aup, SF_Atr;	//scale factor of SR store

	float	Ion[10]; //Ion Array -- 0:Nae, 1:Nai, 2:Ke, 3:Ki, 4:Cae, 5:Cat, 6:Mgi

	float	Condition[4];	//Experiment Condition Array
	/////--- Experimental Condition Variables ---///// 
	//		0:Access Resistance (MOhm)
	//		1:Seal Resistance (MOhm)
	//		2:Ratio of Cell Volume to Electrode
	//		3:temperature
	
	int	m_AP;	//integer for determining current clamp or voltage clamp mode

	/////--- 3-dimension Matrix ---/////
	//	3rd element -- Cell Number for multicellular calculation
	//	2nd element  
	//			m: 1:forward rate constant, 2:backward, 3:m(infinite value), 4:tau, 5:dm/dt, 6:m, 7:m0(previous m), 8:m0(infinite value), 9:tau0
	//			Org: 1:forward), 2:backward, 5:dOrg/dt), 6:Org, 7:Org0
	//			C: 5:dC/dt, 6:C, 7:C0
	//			ii: 1:K selective, 2:Na selective, 3:Ca, 4:total, 5:previous total	
	//	1st element 
	//			m:	3:IRK1, 4:INa, 5:IKr, 6:Ito, 7:Isus, 8:ICaL, 9:ICaT, 10:IKs, 11:Ih, 12:IKACh			
	//			Org: 1:NaCa exchanger, 2:Ca transfer, 3: Ca uptake
	//			C: 1:Ki, 2:Nai, 3:Cai(cytoplasmic total Ca), 4:Ca(uptake pool), 5:Ca(release pool), 6:membrane potential
	//			ii:	3:IRK1, 4:INa, 5:IKr, 6:Ito, 7:Isus, 8:ICaL, 9:ICaT, 10:IKs, 11:Ih, 12:IKACh			
	//			19:ISAC, 20:INSC, 21:INaCa, 22:INaK	
	float C[7][8][3];		//concentration variable
	float Org[4][8][3];		//organelle variable
	float m[NOP+1][10][3];	//gate variable
	float mm[NOP+1][10][3];	
	float h[NOP+1][10][3];	
	float hh[NOP+1][10][3];	 
	float ii[25][6][3];		//current amplitude variable		
	BOOL	NewCell;		//bool variable to start new cell experiment
	
	float E0;   
	BOOL  bUserRate;	//bool variable to use user-rate constants
	BOOL  bRectify;		//rectifing current equation
	float RectifyingK;	//rectifying K channel

	float Ke;			//extracellular K (mM)
	float Ki[3];        //Intracellular K (mM)
	float Nae;			//Extracellular Na (mM)
	float Nai[3];		//Intracellular Na (mM)
	float Cae;			//Extracellular Ca (mM)
	float Caf[3];		//Intracellular Ca (mM)
	float Cafb[3];		//Intracellular Ca (mM)
	float PNAK;			//PNa/PK (ratio)
	float PCAK;			//PCa/PK (ratio)
	float CMAXIM;       //maximal current within screen
	float KCF[3];       //constant field for K
	float NaCF[3];		//constant field for Na
	float CaCF[3];		//constant field for Ca	
	float Vm[3];        //real membrane potential(mV)
	float GfK[3], GfNa[3], ACh[3];   
		
	
	float testpotential;
	int episodeN;				//temporary episode number
	float TotalTime;
	CString Param;				//As Variant
	CString strParam;			//As String
	 
	float P1S;					//option value for which pulse is series pulse
	float P2S;  
	float P3S;
	UINT	iVariablePulse;		//which pulse is variable pulse?
	 
	float timeinterval, timeintervalb, didt;   
	float m_FixedTimeInterval;	
	float stiminterval;
	float CurrentTime;   
	
	float Vi;		//Cell volume
	float Vtotal;   //Cell volume + Electrode volume
	float Mgi;		//Mg ion concentration
	float E;		//command potential(mV)
	float Erev;		//reversal potential at rest(mV)
	float Cap;      //capacitance(pF)
	float rNaCa;   
	float dNaCa;   
	float KmTRPN;		//DISSOCIATION CONSTANT OF TROPONIN Luo & Rudy, Circ Res,74:1071-1096,1994	
	float KmCMDN;		//DISSOCIATION CONSTANT OF CALMODULIN Luo & Rudy, Circ Res,74:1071-1096,1994
	float KmCSQN;		//DISSOCIATION CALSEQUESTRIN OF TROPONIN Luo & Rudy, Circ Res,74:1071-1096,1994
	float TRPNt;		//TOTAL CONCENTRATION OF TROPONIN, mM/L
	float CMDNt;		//TOTAL CONCENTRATIONT OF CALMODULIN, mM/L
	float CSQNt;		//TOTAL CONCENTRATIONT OF CALSEQUESTRIN, mM/L
	float TRPNf[3];		//FREE CONCENTRATION OF TROPONIN, mM/L  necessary to start calculation "buffer"
	float CMDNf[3];		//FREE CONCENTRATION OF CALMODULIN, mM/L	
	
	float Vrel;			//original VOLUME OF RELEASING STORE   
	float Vup;			//original VOLUME OF UPTAKING STORE
	float RVrel;		//ratio of original VOLUME OF RELEASING STORE to cell volume  
	float RVup;			//ratio of original VOLUME OF UPTAKING STORE to cell volume
	
	float Caupmax;			//maximal concentration of Ca in uptake pool
	float Caupinitial;		//initial concentration of Ca in uptake pool   
	float Carelinitial;     //initial concentration of Ca in release pool   
	float Taurel;			//time constant of release
	float Tautr;			//time constant of transfer
	float TauUp;			//time constanat of uptake
	float Iinj[3];   
	float CurrentApplied;   
 
	float DTinfinite;   
	float tauDT;   
	float FTinfinite;   
	float tauFT;   
	float Painfinite;   
	float tauaf;   
	float tauas;   
	float Piinfinite;   
	float taui;   
	 
	float Arel;				//Amplitude factor for Ca release
	float Atr;				//Amplitude factor for Ca transfer	
	float Aup;				//Amplitude factor for Ca uptake

	
	//------------RyR open kinetics-------------//
	float kco[3];
	float kou[3];
	float kuc[3];
	float kcu[3];
	float dRyROpen_dt[3];
	float RyRClose[3];
	float RyROpen[3];
	float dRyRClose_dt[3]; 


	  
	float RGITONa;          //ratio of Transient Outward Na component
	float RGIsusNa;         //ratio of Sustained Outward Na component
	float RGILNSCK;			//relative ratio of K component in NSC	
	float RGILNSCCA;		//relative ratio of Ca component in NSC	
	float RGKNA;			//relative ratio of K component in INa		
	float RGIKrNa;			//relative ratio of Na component in IKr	
	float RGIKsNa;			//relative ratio of Na component in IKs	
	float RGfNa;			//relative ratio of Na component in If
	float PCaLK;			//relative ratio of K component in ICaL
	float PCaLNa;			//relative ratio of Na component in ICaL

	float GSAC[3];			//conductance of Stretch-Activated Channel
	float GbK[3];			
	float GILNSCNa[3];   
	float GNa[3];   
 
	float GITOK[3];   
	float GIsusK[3];   
	float GIRK1[3];   
	float GKr[3];   
	float GIKsK[3];   
 
	float INaKmax[3];   
	float INaCaMax[3];   
	float KNaCa;		
	
	float KmNa;				//Km value for Na sensitivity of Na-K pump	
	float BasalRate;		//basal rate constant for the Na-Ca exchanger
	float NumberofCareer;   
	float Partition_v;   	
	float KNAI;				//dissociation constant for Na at the inner side of the membrane
	float KNAO;				//dissociation constant for Na at the outer side of the membrane
	float KCaI;				//dissociation constant for Ca at the inner side of the membrane
	float KCaO;				//dissociation constant for Ca at the outer side of the membrane
	float KmCa;				//Km value of activation of the Ca release from SR

	float PCaL[3];   	
	float PCaT[3];   
	
 
	int iterative;   
	float qr;   
	float VNa[3];   
	float VK[3];   
	float VCa[3];   
	float L;
 
	float POINF;   
	float A;   
	float B;   
	float ab;   
 
	float cat[3];   
	float Caup[3];   
	float N;  
	float Carel[3];   
	float Cafrel[3];  
	float Cafrelb[3];
	float CSQNf[3];   
  
   
	float Itot[3];   
	float Itotb[3];   
	float Itot_vm[3];   
	
	float Itot_up;		// + current total
	float Itot_down;    // - current total
	float Itot_upb;     // + current total before time interval (previous)
	float Itot_downb;   // - current total before time interval (previous)
	
	float Icap[3];   
	float Icapb[3];   
	float limitfactor;   
	float ICanet[3];   
	float Itr[3];   
	float Irel[3];   
	float Ileak[3];
	float Iup[3];   
	float IKnet[3];   
	float INanet[3];   
 
	float ICaLCainf;   
	float ICaLKinf;   
	float ICaLNainf;   
	float ICaLCa;   
	float ICaLK;   
	float ICaLNa;   
	float ICaTInf;   
	float FF;   
	float PA;   
	float PI;   
 
	float PXI;   
	float PXO;   
	 
	float XsINF;   
	float TAUxs;   
	float PNAO;   
	float PNAI;   
	float PCAO;   
	float PCAI;   
	float k12;   
	float k21;   
	float K30[3];   
	float K03[3];   
	float RTF;   
	float RTF2;   
	int interrupt[2];
	int OpRecord;  
  
	float d[3];		//difference value used to caculate Vm by iterative method
	float hinf;   
	float FS;   
	float P;   
	float sfCap, sfVolF, sfInj, sfTimeL;
	float sf[1];
	CString cell;	//As Variant
	CString Rates;	//As Variant
	CString OpenData;	//As Variant
 
	float RateM[NOP+1][7];   //User Rate Constants Array
	float RateMM[NOP+1][7];   //User Rate Constants Array
	float RateH[NOP+1][7];   //User Rate Constants Array
	float RateHH[NOP+1][7];   //User Rate Constants Array
  
	int DyOp[11];  
 
 
	float TT[1];	//calculate open time or closed time
	int CN;      //channel number
	float poi;	   //initial open probability
	int poiint;   //initial open probability integer
	float TI;    //time interval
	float sALFA;  //rate constant for open -> close
	float sBETA; //rate constant for close -> open
	float KB; //forward rate constant of block
	float KrB; //backward rate constant of block
	float maxrate; 
	int NN;     //channel array sequence
	int LL[1];       //new open close flip variable         '
	float SSUM, SSUM0;   //total open number at time T
	float RD, TTT, RB;   
	float maxicurr;   
	int IVK;
	float IV[1];
	bool IVshow;	//determine to show IV or Raw current
	int linemove;	//to define which line has the choice to move
	float xpos[5];
	float ypos[5]; 
	bool drawnow;	
	int cellNo;  
	BOOL m_Stop;
	virtual ~CHeart10Doc();
public:
	void DefSteps(int iAP);
	void DefInitialVarPreset();
	void SetTimeInterval();
	void PrepareNextPulse();		
	void differen();
	void RUNGEKUTTA();
	void MemoryCurrent();
	
	void RateConstantsUser();
	void RateConstantsDefault();
	void currentamplitude();	
	void RateConstants();
	void constantfield_noma();
	void CABUFFER();
	void dataseparate();
	void CalSteps();
	void calculatevm();
	void INITIALSETTING();	
	void DefIonVar();
	
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CHeart10Doc)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_HEART10DOC_H__404AF2EC_AC93_11D3_8BDF_00C026DD6028__INCLUDED_)