352 - Topic 16 - Laplace Transforms and Discontinuity of forcing terms

699 days ago by Professor352

John Travis

Mississippi College

Playing around with the effects of an impulse forcing term in a second order differential equation.

@interact def _(y0 = slider(1,5,1/10,1,label='$y(0)$'),stepped = slider(1,10,1/10,2,label='Impulse time'), A = slider(-5,5,1/2,3/2,label='Impulse amount')): y0p= 0 html("Solve $y^{''}+2y^{'}+2y = %s$"%str(latex(A))+"$\delta(t-%s)$"%str(latex(stepped))) var('t') y = y0*e^(-t)*(cos(t)+sin(t))+A*e^(-(t-stepped))*sin(t-stepped)*unit_step(t-stepped) G = text('impulse',(stepped,0.1),color='red')+plot(y,(t,0,stepped*5)) G.show() 
       

Click to the left again to hide and once more to show the dynamic interactive window

# Thus far, sage (via maxima) cannot handle inverse laplace transforms involving delta functions y=function('y',t) eq = diff(y,t,2)+2*diff(y,t,1)+2*y==3*unit_step(t-2) # eq = diff(y,t,2)+2*diff(y,t,1)+2*y==3*dirac_delta(t-2) # desolve_laplace(eq,y,ics=[0,5,0]) desolve_laplace(eq,y) 
       
Traceback (click to the left of this block for traceback)
...
TypeError: unable to make sense of Maxima expression
'ilt(e^-(2*?g3675)*((y(0)*?g3675^2+(at(diff(y(t),t,1),t=0)+2*y(0))*?g367\
5)*e^(2*?g3675)+3)/(?g3675^3+2*?g3675^2+2*?g3675),?g3675,t)' in Sage
Traceback (most recent call last):    # desolve_laplace(eq,y,ics=[0,5,0])
  File "", line 1, in <module>
    
  File "/tmp/tmpvLVxgN/___code___.py", line 9, in <module>
    exec compile(u'desolve_laplace(eq,y)
  File "", line 1, in <module>
    
  File "/usr/local/sage-6.1.1/local/lib/python2.7/site-packages/sage/calculus/desolvers.py", line 671, in desolve_laplace
    soln=soln.sage()
  File "/usr/local/sage-6.1.1/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 869, in sage
    return self._sage_()
  File "/usr/local/sage-6.1.1/local/lib/python2.7/site-packages/sage/interfaces/maxima_abstract.py", line 1224, in _sage_
    maxima=self.parent())
  File "/usr/local/sage-6.1.1/local/lib/python2.7/site-packages/sage/calculus/calculus.py", line 1839, in symbolic_expression_from_maxima_string
    raise TypeError("unable to make sense of Maxima expression '%s' in Sage"%s)
TypeError: unable to make sense of Maxima expression 'ilt(e^-(2*?g3675)*((y(0)*?g3675^2+(at(diff(y(t),t,1),t=0)+2*y(0))*?g3675)*e^(2*?g3675)+3)/(?g3675^3+2*?g3675^2+2*?g3675),?g3675,t)' in Sage