Simple pharmacokinetics with VBA


Here you find a simple model of pharmacokinetics with VBA:

Private Sub pharmacokinetic()

Dim Ka, F, A0, K, V, t, Tmax, cmax, t12 As Double

Ka = InputBox("Ka costant of absorption h-1", "input data")

K = InputBox("K costant of elimination h-1", "Input data ")

V = InputBox("Volume liter/kg", "input data")

F = InputBox("bioavailability", "input data")

A0 = InputBox("dose mg ", "input data")

dt = InputBox("interval of time h", "Input data ")

t = 0

j = 0

Do

j = j + 1

t = t + j * dt

c = F * A0 * Ka / V / (Ka - K) * (Exp(-K * t) - Exp(-Ka * t)) 'concentration profile for dosing oral A0

Cells(j, 1) = t

Cells(j, 2) = c

Loop While j < 8

r = Ka / K

Tmax = 1 / (Ka - K) * Log(r)

cmax = F * A0 / V * Exp(-K * Tmax) 'maximum concentration at tmax

t12 = Log(2) / K 'half life of drug


Cells(1, 10) = Tmax

Cells(1, 11) = cmax

Cells(1, 12) = t12


End Sub

要查看或添加评论,请登录

alfredo ruggiero的更多文章

  • ISO 14001

    ISO 14001

    CAPITOLI: L’ANALISI AMBIENTALE INIZIALE LA PIANIFICAZIONE DEL SISTEMA IL PIANO DEGLI INTERVENTI GLI OBIETTIVI…

    1 条评论
  • Forced Vibration with VBA

    Forced Vibration with VBA

    Private Sub forcedvibration() 'program to determine the dispacement of a system (Mass + spring) X subject to force =…

  • Quadratic regression analysis with VBA

    Quadratic regression analysis with VBA

    Private Sub correlationquadratic() 'y=A*X^2+B*X+C 'Calculate the coefficient A,B,C with quadratic regression Dim sx…

  • Beam fixed at both ends under distributed load with VBA

    Beam fixed at both ends under distributed load with VBA

    Private Sub beamfixed() Dim E, I, L, W, x, M, Ws, A As Double E = InputBox("young moduleus kg/mm2", "input data") I =…

  • Cantilever under distributed load with VBA

    Cantilever under distributed load with VBA

    Private Sub cantilever() ' calculation of cantilever under distributed load Dim E, I, L, W, x, M, Ws, B, A, C As Double…

  • simple beam under distributed load with VBA

    simple beam under distributed load with VBA

    Here is a VBA calculation of a single beam under distributed load. Private Sub beam() Dim E, I, L, W, x, M, Ws As…

  • Impedance of series and parallel circuit with VBA

    Impedance of series and parallel circuit with VBA

    Private Sub impedance() Dim R, C, L, F As Double Dim A As Integer R = InputBox("Resistence ohm", "input data") C =…

  • simple linear regression with VBA

    simple linear regression with VBA

    I share a simple program in VBA for linear regression Private Sub correlazione() n = InputBox("number variables", "…

  • net present value of an investiment calculation with VBA

    net present value of an investiment calculation with VBA

    I want to share a VBA program for estimation of NPV. You can evaluate the effect of tax rate and interest and…

  • kinetics second order excel VBA

    kinetics second order excel VBA

    Description Ecel VBa program for kinetics second order speed evalaution Private Sub CommandButton1_Click() Dim A, W…

社区洞察

其他会员也浏览了