Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SIR desolve_system

var('beta gamma S I R N') dS = - beta * S * I /N dI = beta * S * I / N - gamma * I dR = gamma * I

equilibria = solve([dS, dI, dR], [S, I, R]) show(equilibria) solve([dS == 0, dI == 0, dR == 0], [S, I])

and the output is [[S == r76, I == 0, R == r77]] but I know that there is a second one with S == 0, I == 0 and R == 0. I have tried using desolve_system in the hopes that it prints out both answers but it asks for the ivar and I need it to solve both S and I. Is there some other way or command that I can use where sage will give me both [S == r1, I == 0, R == r1] and [ S == I == R == 0]?

SIR desolve_system

var('beta gamma S I R N') dS = - beta * S * I /N dI = beta * S * I / N - gamma * I dR = gamma * I

equilibria = solve([dS, dI, dR], [S, I, R]) show(equilibria) solve([dS == 0, dI == 0, dR == 0], [S, I])

and the output is [[S == r76, I == 0, R == r77]] but I know that there is a second one with S == 0, I == 0 and R == 0. I have tried using desolve_system in the hopes that it prints out both answers but it asks for the ivar and I need it to solve both S and I. Is there some other way or command that I can use where sage will give me both [S == r1, I == 0, R == r1] and [ S == I == R == 0]?