Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to find and plot both steady periodic solution and actual solution?

Hi! I haven't been able to figure out how to do this in Sage, Let's say I have the differential equation with initial values

x''+4x'+5x=15cos(4t), x(0)=0, x'(0)=0

And want to find both the steady periodic solution as well as the full solution

When I put in

f=function('f')(x)
de=diff(f,x,2)+4*diff(f,x)+5*f==15*cos(4*x)
z=desolve_laplace(de,dvar=f,ics=[0,0,0])
show(expand(z))

I get

165/377*cos(x)*e^(-2*x) - 630/377*e^(-2*x)*sin(x) - 165/377*cos(4*x) + 240/377*sin(4*x)

But the answer is actually

Xsp(t) = 0.773cos(4t-2.173)
X(t) = 0.773cos(4t-2.173)+1.727e^(-2t) *cos(t-4.969)

And I have no idea how to graph this, but I'm pretty sure that's fairly easy. I know there's the manual way of doing everything, but that takes a lot of time and I think Sage can do it better and faster

I appreciate all help!