Question: Plot output of Loop

Hey there, I am trying to plot R0 vs x with my output of a loop. Just wondering how I go about this and I am not very coding savvy, so my apologies. My code is below.

for Lambda from 40 to 80 do R0 := eval(R[0], {mu = m, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); qq := eval(Y, {mu = m, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); x1 := RootOf(qq, index = 1); x2 := RootOf(qq, index = 2); X1 := simplify(x1); X2 := simplify(x2); Icr1 := eval(Ic, {mu = m, x = X1, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); Scr1 := eval(Sc, {mu = m, x = X1, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); Skr1 := eval(Sk, {mu = m, x = X1, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); Icr2 := eval(Ic, {mu = m, x = X2, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); Scr2 := eval(Sc, {mu = m, x = X2, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); Skr2 := eval(Sk, {mu = m, x = X2, delta = del, gamma = g, omega = o, d[1] = dk, d[2] = dc, alpha[1] = ak, alpha[2] = ac, beta[1] = b1, beta[3] = b3}); if X1 >= 0 then if 0 < Scr1 then if 0 < Skr1 then if 0 < Icr1 then print('one', Lambda, R0, X1, Icr1, Scr1, Skr1) end if end if end if end if; if X2 >= 0 then if 0 < Scr2 then if 0 < Skr2 then if 0 < Icr2 then print('two', Lambda, R0, X2, Icr2, Scr2, Skr2) end if end if end if end if end do:

 

Basically, Icri, Scri, Skri are values for potential equilibrium of a biological system, s, thus I need to only plot/consider the x values that give positive answers for these points, I have figured out how to get the output but not how to store the x as an array and the R0 as an array to plot. The plot is going to be a bifurcation diagram for specific parameter values, and requires the stable equilibrium points to have solid lines connecting the (R0,x) points and dashed lines for the unstable points. 

Thanks in advance for any input you have. 

J

Please Wait...