Find a continuous solution to an ODE that includes a step function

In summary, the solution to the non-homogeneous first order ODE is found by taking the Laplace transform and using time-shift rules.
  • #1
Robaj
13
3
Homework Statement
Find a continuous solution of the initial value problem ##y'+y=g(t)##, ##y(0)=0## where $$g(t)=\begin{cases}
2, & 0\le t \le 1 \\
0, & t \gt 1
\end{cases}$$

This is Ex. 17 from Braun's Differential Equations and Their Applications. I can get the answer for the second case but not the first.
Relevant Equations
The answer is given as
$$y(t)=\begin{cases}
2(1-e^{-t}),&\, 0\le t \le 1 \\
2(e-1)e^{-t},& \, t \gt 1
\end{cases}
$$
Non-homegenous first order ODE so start with an integrating factor ##\mu##
$$\mu=\textrm{exp}\left(\int a dt\right)=e^t.$$
Then rewrite the original equation as
$$\frac{d}{dt}\mu y = \mu g(t).$$
Using definite integrals and splitting the integration across the two cases,
$$\begin{align} ye^t-0e^0 &= \int_0^1 2e^s ds + \int_1^t 0e^s ds\\
ye^t &= 2\left[e^s\right]_0^1+0\left[e^s\right]_1^t \\
ye^t &= 2e^1-2 \\
y(t) &= 2(e-1)e^{-t}.\end{align}$$

This is Braun's answer for the case ##t \gt 1##. How can I get the solution for ##0\le t \le 1##? Have I done something wrong with the second definite integral (integrating 0)?

Thanks.
 
Physics news on Phys.org
  • #2
Why don't you solve
[tex]y'+y=2,y(0)=0[/tex]?
 
  • Like
Likes Robaj
  • #3
Robaj said:
Homework Statement:: Find a continuous solution of the initial value problem ##y'+y=g(t)##, ##y(0)=0## where $$g(t)=\begin{cases}
2, & 0\le t \le 1 \\
0, & t \gt 1
\end{cases}$$

This is Ex. 17 from Braun's Differential Equations and Their Applications. I can get the answer for the second case but not the first.
Relevant Equations:: The answer is given as
$$y(t)=\begin{cases}
2(1-e^{-t}),&\, 0\le t \le 1 \\
2(e-1)e^{-t},& \, t \gt 1
\end{cases}
$$

Non-homegenous first order ODE so start with an integrating factor ##\mu##
$$\mu=\textrm{exp}\left(\int a dt\right)=e^t.$$
Then rewrite the original equation as
$$\frac{d}{dt}\mu y = \mu g(t).$$
Using definite integrals and splitting the integration across the two cases,
$$\begin{align} ye^t-0e^0 &= \int_0^1 2e^s ds + \int_1^t 0e^s ds\\
ye^t &= 2\left[e^s\right]_0^1+0\left[e^s\right]_1^t \\
ye^t &= 2e^1-2 \\
y(t) &= 2(e-1)e^{-t}.\end{align}$$

This is Braun's answer for the case ##t \gt 1##. How can I get the solution for ##0\le t \le 1##? Have I done something wrong with the second definite integral (integrating 0)?

Thanks.

If [itex]t < 1[/itex] the upper limit of the first integral is not [itex]1[/itex] but [itex]t[/itex]. The second integral vanishes whatever the value of [itex]t[/itex].
 
  • Like
Likes Robaj
  • #4
anuttarasammyak said:
Why don't you solve
[tex]y'+y=2,y(0)=0[/tex]?
Thanks, this gives me the result for ##0\le t\le 1##, although now I'm not sure about the case for ##t\gt 1##.
 
  • #5
pasmith said:
If [itex]t < 1[/itex] the upper limit of the first integral is not [itex]1[/itex] but [itex]t[/itex]. The second integral vanishes whatever the value of [itex]t[/itex].

Thanks for pointing out my mistake. How can I solve for ##y(t)## when ##g(t)=0## if the second integral always vanishes?

If ##g(t)=0## then
$$
\begin{align}
\frac{y'}{y} &= -1\\
\ln y &= -\int_1^t 0e^s ds +c = 0
\end{align}
$$
Perhaps I'm confusing the integration limits with the initial conditions.
 
  • #6
I guess the question is: how can I get to ##y(t)=2(e-1)e^{-t}## when ##g(t)=0##?
 
  • #7
Solving
[tex]y'+y=c[/tex]
[tex]y=ae^{-t}+c[/tex]
From below to t=1 together with y(t=0)=0
[tex]y=-2e^{-t}+2=-2e^{-1}+2[/tex]
From above to t=1
[tex]y=ae^{-t}=ae^{-1}[/tex]
So that they equal
[tex](a+2)e^{-1}=2[/tex]
 
  • #8
Robaj said:
Thanks for pointing out my mistake. How can I solve for ##y(t)## when ##g(t)=0## if the second integral always vanishes?

If ##g(t)=0## then
$$
\begin{align}
\frac{y'}{y} &= -1\\
\ln y &= -\int_1^t 0e^s ds +c = 0
\end{align}
$$
Perhaps I'm confusing the integration limits with the initial conditions.

Definite integrals do not result in arbitrary constants.

If [itex]y' + y = 0[/itex] then [itex](e^{t}y)' = 0[/itex]. Integrating you find [tex]
e^t y(t) - e^1 y(1) = 0[/tex] ie. [itex]y(t) = y(1) e^{1-t}[/itex].

Alternatively, from [itex]y'/y = -1[/itex] it follows that [tex]
\int_{y(1)}^{y(t)} \frac1u\,du = \int_1^t(-1)\,ds[/tex] and hence [itex]\ln|y(t)| - \ln|y(1)| = 1 - t[/itex] as expected.
 
  • Like
Likes Robaj
  • #9
Thanks both, it seems trivial in hindsight!
 
  • #10
Hi,

I know this has been solved now but just thought it was worth pointing out that perhaps Laplace transforms help to get the full solution as well. Also, we have zero initial conditions, which makes the algebra even easier.

For example, we can take the Laplace transform of the differential equation to get:[tex] Y(s) = \frac{2}{s(s +1)} \left( 1 - e^{-s} \right) [/tex]
where the second term in the bracket ## e^{-s} ## is a time-shift. Then we can use partial fractions to get:
[tex] Y(s) = \left(\frac{2}{s} - \frac{2}{s+1}\right) \left( 1- e^{-s} \right) [/tex]
Then we can take the inverse Laplace transform, by applying some basic time-shift rules, to get:
[tex] y(t) = 2u(t)(1 - e^{-t}) - 2u(t - 1) \left( 1 - e^{-(t - 1)} \right) [/tex]
where ## u(t - a) ## is the step function and is 0 for ## t < a ##. I think the expression simplifies to the required solutions.

Hope that made some sense. Could use this as a way to check a solution.
 

1. What is a step function in the context of an ODE?

A step function is a type of function that changes suddenly from one constant value to another at a specific point. In the context of an ODE, a step function represents a sudden change in the behavior of the system being modeled.

2. Why is it important to find a continuous solution to an ODE that includes a step function?

It is important to find a continuous solution to an ODE that includes a step function because it allows us to accurately model and predict the behavior of systems that exhibit sudden changes. A discontinuous solution would not accurately reflect the behavior of the system and could lead to incorrect conclusions.

3. What are the challenges in finding a continuous solution to an ODE that includes a step function?

One of the main challenges in finding a continuous solution to an ODE that includes a step function is determining the appropriate initial conditions and boundary conditions to use in the solution. Additionally, the step function may introduce discontinuities in the solution, which must be properly addressed.

4. How can we mathematically represent a step function in an ODE?

A step function can be represented mathematically in an ODE using the Heaviside step function, also known as the unit step function. This function is defined as 0 for x < 0 and 1 for x ≥ 0. It can be used to model a sudden change in a system's behavior at a specific point.

5. Are there any real-world applications of ODEs with step functions?

Yes, there are many real-world applications of ODEs with step functions. Some examples include modeling the spread of infectious diseases, predicting the behavior of electrical circuits, and analyzing the dynamics of chemical reactions. In all of these cases, the step function represents a sudden change in the system's behavior that must be accounted for in the ODE solution.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
337
  • Calculus and Beyond Homework Help
Replies
16
Views
567
  • Calculus and Beyond Homework Help
Replies
1
Views
708
  • Calculus and Beyond Homework Help
Replies
3
Views
497
  • Calculus and Beyond Homework Help
Replies
8
Views
240
  • Calculus and Beyond Homework Help
Replies
2
Views
161
  • Calculus and Beyond Homework Help
Replies
12
Views
994
  • Calculus and Beyond Homework Help
Replies
1
Views
540
  • Calculus and Beyond Homework Help
Replies
3
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
573
Back
Top