Hi, 

I'm starting with Sage, and I hope somebody can give me a hand. I'm
trying to solve the following problem:

Use Sage to check that the general solution to the falling body problem
mv′ + kv = mg, is v(t) = mg/k + c*exp(−kt/m). If v(0) = v0 , you can
solve for c in terms of v0 to get c = v0 − mg/k. Take m = k = v0 = 1, g
= 9.8 and use Sage to plot v(t) for 0 < t < 1

My attempt seems correct, but surely not very elegant:      

sage: m,k,g,t = var('m k g t')
sage: v = function('v',t)
sage: desolve(m * diff(v,t) + k * v - m * g , v, ivar=t)
(g*m*e^(k*t/m)/k + c)*e^(-k*t/m)
sage: fv = _
sage: c,v0 = var('c v0')
sage: solve(fv(t=0)==v0,c)
[c == -(g*m - k*v0)/k]
sage: solve(fv(t=0,m=1,k=1,g=9.8,v0=1)-1,c)
[c == (-44/5)]
sage: plot(fv(m=1,k=1,g=9.8,c=-44/5),0,1)

Can somebody show me the Sage way?

Thanks a lot,
-- 
Ángel de Vicente


-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to