SAGE : Section 6.4 Solving Equations with Discontinuous Forcing Functions

Example 1  Solve the equation $y''+3y'+2y=h(t)$; $y(0)=8$ and $y'(0)=0$, where $h(t)=\begin{cases} 4t & 0\le t \lt 1 \\ 4 & 1\leq t \lt 2 \\ 0 & t\ge t \end{cases}$.

First create the unit step function, and plot $h(t)$ along with the homogeneous solution:

Plot the solution to the forced equation:

Graph all three functions to see the affect of the discontiuous forcing function.

Example 2  Determine the qualitative behavior of the solution to the equation $2y''+2y'+5y=h(t)$; $y(0)=10$ and $y'(0)=0$, where $h(t)=\begin{cases} 10 & 5\le t \lt 10 \\ 0 & \text{elsewhere} \end{cases}$.

Plot the homogeneous solution and the forcing function:

Now plot the solution to the forced equation:

And plot all three together:

Example 3: done on paper

Example 4: Use a CAS to help solve $2y''+y'+30y=f(t)$ where $f$ is a constant force of 150 from $t=5$ to $t=8$.