This simulation predicts the spread of HIV infection in a body with an initial infection. The human immunodeficiency virus (HIV) infection spreads and can develop into acquired immunodeficiency syndrome (AIDS). AIDS can lead to immune system failure and eventual inability to defend the body against infection or cancer. Without treatment with antiretroviral drugs, survival time after infection with HIV is about 9 to 11 years, depending on a number of factors. Antiretroviral drugs such as TDF…

Thank you so much for this! You explain this in such an understandable way.

How can I see the simulated value at a particular time, for example: no. of healthy cells at t=7 or say finding the exact steady state values?

I almost lost my patience while looking at some examples of couple differential equations. Thank you for your amazing tutorials.

Actually, you saved my life too! Thanks a lot, and all that films are very usefull

How did you arrive with the value of 100 for the initial value of the free virus cell count? I cannot find this value in the reference book chapter.

life saver !!!!

No not really life but saved part of my life, may be 4 or 5 months :)) apreciate it. thanks.

Great tutorial! I couldn't find the patient data in the given link, so let me share: [ http://apmonitor.com/do/uploads/Main/data_hiv.zip ]

Do you have any tutorials on how to create an ODE of N differential equations (let's say dydt(i)) and solve it?

You literally just saved my life! Thank you so much, now I understand what I have to do with my project! <3

#——————————————————————————-

# Name: HIV simulation

# Purpose: with administration of antivirus drugs A,kr7

# ——————————————————————————-

import numpy as np

from scipy.integrate import odeint

import matplotlib.pyplot as plt

def hiv(x,t):

kr1 = 1e5 #new healthy cells

kr2 = 0.1 #death rate of healthy cells

kr3 = 2e-7 #healthy cells converting to infected cells

kr4 = 0.5 #death rate of infected cells

kr5 = 5 #death rate of virus

kr6 = 100 #production of virus by infected cells

kr7 = 1.0

if t>3.0: # drugs begin at year 3

A = 100.0 #A = 0 means no drugs administration

else:

A = 0.0

h = x[0]

i = x[1]

v = x[2]

p = kr3*h*v

dhdt = kr1 – kr2*h – p

didt = p – kr4*i

dvdt = -p – kr5*v + kr6*i – kr7*A*v # drugs will eliminate proportionally with A*v

return [dhdt, didt, dvdt]

def main():

#Initial Conditions

x0 = [1e6,0,100]

#print(hiv(x0,0))

t = np.linspace(0,15,1000) #graph over 15 years, 1000 points

x = odeint(hiv,x0,t)

#print(x)

h = x[:,0]

i = x[:,1]

v = x[:,2]

plt.semilogy(t,h,'g:',label='h(t)')

plt.semilogy(t,i,'b-',label='i(t)')

plt.semilogy(t,v,'r–',label='v(t)')

plt.xlabel('time in years')

plt.legend(loc='best')

plt.show()

if

_name_== '__main__':main()

Good Stuff! Thank you.