3 Start:elapsed_real_time()$
10 g(v):= ginf*v/(v+100)$
11 f(v):= 20.0*v/(v+1.0)$
18 [Solution,[tlist,ylist]]: Eulix([p - sx*x -rx*x*v +g(v)*x,
20 n*g(v)*y +f(v) -sv*v -(rx+rv)*x*v],[x,y,v],
21 [1000.0,0,1.0],[t,0.0,12*365+4,1,v-t-245.0],
22 initial_step_size=1,absolute_tolerance=1e-8,logging=Logging,
23 combined_t_y_list=false)$
24 print("I've used ",elapsed_real_time()-Start,"seconds for computing the AIDS model")$
25 print("Solution triggered by condition",first(Solution)," at time ",second(Solution),
26 " and state:",third(Solution))$
28 y1init:third(Solution)$
29 [tlist2,ylist2]: Eulix([p - sx*x -rx*x*v +g(v)*x,
31 n*g(v)*y +f(v) -sv*v -(rx+rv)*x*v],
32 [x,y,v],y1init,[t,t1,12*365+4,1],
33 absolute_tolerance=1e-8,logging=Logging,
34 combined_t_y_list=false)$
36 tlist:append(tlist,tlist2)$
37 ylist:append(ylist,ylist2)$
39 print("tlist:",tlist[tlen]," ylist:",ylist[tlen])$
40 log10(z):= if z > 0 then log(z)/log(10) else 0$
41 tlist:tlist/365.4$ t1:t1/365.4$
42 plot2d([[discrete,tlist,map(lambda([z],log10(z[1])),ylist)],[discrete,tlist,map(lambda([z],log10(z[2])),ylist)],
43 [discrete,tlist,map(lambda([z],log10(z[3])),ylist)],
44 [discrete,[t1,t1],[0,5]]],
45 [legend,"healthy","infected","AIDS-viruses","root location"],[title,"An AIDS model"])$
46 read("enter ; or $ to quit");