Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

visualizing logistic population growth

This is a followup question to this question where @mforets help me translate some Ti Nspire code to Sagemath code. I now have following,

t = var('t')
y = function('y')(t)
ye = desolve(diff(y,t) == 2*10^(-5)*y*(1500-y), y, ics=[0,50])
ye = ye*3/100
yt = solve(ye.simplify_log(), y)
show(expand(yt))

New I'm interested to visualize this result. I looked at the examples given in the Sage Quickstart for Differential Equations, but I cold not reproduce what was there with my exsample.

My lecture notes has a lot like this that I'm aim at image description

I've tried things like,

var('t')
plot(ye,(t,0,300))

and

var('t')
plot(yt,(t,0,300))

but I keep getting the error 'unable to simplify to float approximation'. Can anyone here help me?

visualizing logistic population growth

This is a followup question to this question where @mforets help helped me translate some Ti Nspire code to Sagemath code. I now have following,

t = var('t')
y = function('y')(t)
ye = desolve(diff(y,t) == 2*10^(-5)*y*(1500-y), y, ics=[0,50])
ye = ye*3/100
yt = solve(ye.simplify_log(), y)
show(expand(yt))

New Now I'm interested to visualize this result. result, reproducing some lecture notes. I looked at the examples given in the Sage Quickstart for Differential Equations, but I cold not reproduce what was there with my exsample.example.

My lecture notes has a lot like this that I'm aim at image description

I've tried things like,

var('t')
plot(ye,(t,0,300))

and

var('t')
plot(yt,(t,0,300))

but I keep getting the error 'unable to simplify to float approximation'. Can anyone here help me?

visualizing logistic population growth

This is a followup question to this question where @mforets helped me translate some Ti Nspire code to Sagemath code. I now have following,

t = var('t')
y = function('y')(t)
ye = desolve(diff(y,t) == 2*10^(-5)*y*(1500-y), y, ics=[0,50])
ye = ye*3/100
yt = solve(ye.simplify_log(), y)
show(expand(yt))

Now I'm interested to visualize this result, reproducing some lecture notes. I looked at the examples given in the Sage Quickstart for Differential Equations, but I cold not reproduce what was there with my example.

My lecture notes has a lot like this that I'm aim at image description

I've tried things like,By copying the right hand side (code below figure) manually I can get this, but I feel like I'm missing something; image description

var('t')
plot(ye,(t,0,300))
P = plot((1500*e^(3/100*t)/(e^(3/100*t) + 29)),t,0,250, color='red')
L = line([(0,1500), (260,1500)], linestyle=":", color="grey")
show(P+L, figsize=5)

and

var('t')
plot(yt,(t,0,300))

but I keep getting the error 'unable to simplify to float approximation'. Can anyone here help me?