I was able to figure out how to solve the system with using only one parameter. Here are my lines:
clear allclcsyms t x a for a = [0:.25:1];g = @(t,x,a)[3*(a-1)*x(1)+.01*x(3)-.0005*x(1)*x(2);.0005*x(1)*x(2)-.05*x(2)-.02*x(2);3*a+.05*x(2)-.01*x(3)];[t,xa] = ode45(@(t,x) g(t,x,a),[0 50],[990 10 0]);figureplot(t,xa(:,1),t,xa(:,2),t,xa(:,3))title(['Viral Spread of Infection'])xlabel('t (days)')ylabel('Population')legend('S','I','R')end
but now I am wanting to add another parameter "q" so that q = 0:2:10 and
g = [3*(a-1)*x(1)+.01*x(3)-.0005*x(1)*x(2)-q*x(2);.0005*x(1)*x(2)-.05*x(2)-.02*x(2)-q*x(2);3*a+.05*x(2)-.01*x(3)];
I tried just adding q to the same places as a, but it didn't work.
Please help!
Best Answer