Solve system of two differential equations

In summary: V \end{pmatrix}[/tex] If you know how to solve the scalar equation u'= -u+ (1/2)sin(t)+ 3/2, you can solve the system. You say that you know how to solve a scalar equation u'= au+ g(t) if you know how to solve the homogeneous equation u'= au. That's not really true, but it is true that if you know how to solve the homogeneous equation, you can find a solution to the non-homogeneous equation by variation of parameters. That is, you assume a solution of the form U= Ce^{at} and then multiply that by the antiderivative of g(t), add the antiderivative
  • #1
skrat
748
8

Homework Statement


Solve the system
##\dot{x}=-2x+y+5sint## and ##\dot{y}=x-2y+3## for ##x(0)=1## and ##y(0)=1##


Homework Equations





The Attempt at a Solution



Well, I tried expressing x from the second equation, derived it and inserted it in the first equation but this process is long. Just to be clear, I will write a few steps..:
from second equation ##x=\dot{y}+2y-3## therefore ##\dot{x}=\ddot{y}+2\dot{y}##

Now inserting these two in the first expression gives me ##\ddot{y}+4\dot{y}+3y=6+5sint##

Homogeneous part is: ##y_h=Ae^{-t}+Be^{-3t}##

particular 1 (for the constant polynom 6): Constant C=2

particular 2 (for sin function): ##y_p=\frac{1}{2}sint-cost##

All together, the solution is than: ##y=Ae^{-t}+Be^{-3t}+\frac{1}{2}sint-cost+2##

and x from ##x=\dot{y}+2y-3= Ae^{-t}-Be^{-3t}+\frac{1}{2}cost+2sint-3##

because ##x(0)=1## and ##y(0)=1##, than ##A=-B=\frac{7}{4}##

HOWEVER, I do know that this can be done using matrices... It goes somehow like this...:

##\begin{bmatrix}
\dot{x}\\
\dot{y}
\end{bmatrix}=\begin{bmatrix}
-2 & 1\\
1& -2
\end{bmatrix}\begin{bmatrix}
x\\
y
\end{bmatrix}+\begin{bmatrix}
5sint\\
3
\end{bmatrix}##

Eigenvalues ##\lambda _1=-1## and ##\lambda _2=-3## give eigenvectors for matrix ##A=\begin{bmatrix}
-2 & 1\\
1& -2
\end{bmatrix}##:

##v_1=(-1,1)## and ##v_2=(1,1)##

SO, now my question:

What will the solution look like? If the system would me homogeneous it would be something like ##\vec{r}=Pe^{Dt}\vec{c}## where P is matrix from eigenvectors and D matrix from eigenvalues. C is vector of constants.
But my system also has 5sint and +3 ... What do I do now?

Thanks for all the help!
 
Physics news on Phys.org
  • #2
Not sure if it's what you're thinking of, but here's one way.
In matrix form, you have ##\dot x = A x + B(t) ## where A is constant. Writing D for the differential operator, (D-A)x = B, x = -(A-D)-1B = A-1(I-A-1D)-1B.
Expanding binomially, x = A-1Æ©A-nDnB. If you write that out I think you'll see how to sum the series.
 
  • #3
skrat said:

Homework Statement


Solve the system
##\dot{x}=-2x+y+5sint## and ##\dot{y}=x-2y+3## for ##x(0)=1## and ##y(0)=1##


Homework Equations





The Attempt at a Solution



Well, I tried expressing x from the second equation, derived it and inserted it in the first equation but this process is long. Just to be clear, I will write a few steps..:
from second equation ##x=\dot{y}+2y-3## therefore ##\dot{x}=\ddot{y}+2\dot{y}##

Now inserting these two in the first expression gives me ##\ddot{y}+4\dot{y}+3y=6+5sint##

Homogeneous part is: ##y_h=Ae^{-t}+Be^{-3t}##

particular 1 (for the constant polynom 6): Constant C=2

particular 2 (for sin function): ##y_p=\frac{1}{2}sint-cost##

All together, the solution is than: ##y=Ae^{-t}+Be^{-3t}+\frac{1}{2}sint-cost+2##

and x from ##x=\dot{y}+2y-3= Ae^{-t}-Be^{-3t}+\frac{1}{2}cost+2sint-3##

because ##x(0)=1## and ##y(0)=1##, than ##A=-B=\frac{7}{4}##

HOWEVER, I do know that this can be done using matrices... It goes somehow like this...:

##\begin{bmatrix}
\dot{x}\\
\dot{y}
\end{bmatrix}=\begin{bmatrix}
-2 & 1\\
1& -2
\end{bmatrix}\begin{bmatrix}
x\\
y
\end{bmatrix}+\begin{bmatrix}
5sint\\
3
\end{bmatrix}##

Eigenvalues ##\lambda _1=-1## and ##\lambda _2=-3## give eigenvectors for matrix ##A=\begin{bmatrix}
-2 & 1\\
1& -2
\end{bmatrix}##:

##v_1=(-1,1)## and ##v_2=(1,1)##

SO, now my question:

What will the solution look like? If the system would me homogeneous it would be something like ##\vec{r}=Pe^{Dt}\vec{c}## where P is matrix from eigenvectors and D matrix from eigenvalues. C is vector of constants.
But my system also has 5sint and +3 ... What do I do now?

Thanks for all the help!

If you know how to compute the matrix exponential ##e^{uA}## for scalar ##u## you can solve the linear system
[tex] \dot{x} = A x + h(t)[/tex]
as
[tex] x(t) = e^{At} x(0) + \int_0^t e^{(t-s)A} h(s) \, ds.[/tex]

The easiest way to get the matrix exponential is to note that for an nxn matrix with distinct eigenvalues ##r_1, r_2, \ldots, r_n## we have
[tex] f(A) = \sum_{j=1}^n E_j f(r_j) [/tex]
for any analytical function ##f(x) = c_0 + c_1 x + c_2 x^2 + \cdots## (with ##f(A)## defined as ## c_0 I + c_1 A + c_2 A^2 \cdots ##). Here, the matrices ##E_1, E_2, \ldots, E_n## are the same for any function f, so we can find them by looking at some simple, convenient functions. In particular,
[tex] f(x) = 1 = x^0 \Longrightarrow A^0 = I = E_1 r_1^0 + E_2 r_2^0 = E_1 + E_2 \\
f(x) = x \Longrightarrow A^1 = A = E_1 r_1 + E_2 r_2[/tex]
for the 2x2 case with two distinct nonzero eigenvalues ##r_1, r_2##. Thus, we get ##E_1,E_2## by solving
[tex] E_1 + E_2 = I\\
r_1 E_1 + r_2 E_2 = A [/tex]
Now we can determine the matrix exponential from
[tex] f(x) = e^{ux} \Longrightarrow e^{uA} = E_1 e^{u r_1} + E_2 e^{u r_2}.[/tex]
 
  • #4
Here's how I would do it. The matrix [itex]\begin{pmatrix}-2 & 1 \\ 1 & -2 \end{pmatrix}[/itex]
has eigenvalues -1 and -3 with corresponding eigenvectors [itex]\begin{pmatrix}1 \\ 1\end{pmatrix}[/itex] and [itex]\begin{pmatrix}1 \\ -1\end{pmatrix}[/itex]. That tells us that
[tex]\begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2\end{pmatrix}\begin{pmatrix}-2 & 1 \\ 1 & -2\end{pmatrix}\begin{pmatrix}1 & 1 \\ 1 & -1 \end{pmatrix}= \begin{pmatrix}-1 & 0 \\ 0 & -3\end{pmatrix}[/tex]

([itex]\begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2\end{pmatrix}[/itex] is the inverse matrix to [itex]\begin{pmatrix}1 & 1 \\ 1 & -1\end{pmatrix}[/itex], the matrix having the eigenvectors as columns.)

Multiplying both sides of [itex]\begin{pmatrix}x' \\ y'\end{pmatrix}= \begin{pmatrix}-2 & 1 \\ 1 & -2\end{pmatrix}+ \begin{pmatrix}5 sin(t) \\ 3\end{pmatrix}[/itex] by [itex]\begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2\end{pmatrix}[/itex] gives
[tex]\begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2 \end{pmatrix}\begin{pmatrix}x' \\ y'\end{pmatrix}= \begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2 \end{pmatrix}\begin{pmatrix}-2 & 1 \\ 1 & -2\end{pmatrix}\left(\begin{pmatrix}1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2\end{pmatrix}\right)\begin{pmatrix}x \\ y\end{pmatrix}+ \begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2 \end{pmatrix}\begin{pmatrix}5 sin(t) \\ 3\end{pmatrix}[tex]
where I have used the fact that [tex]\begin{pmatrix}1/2 & 1/2 \\ 1/2 & -1/2 \end{pmatrix}\begin{pmatrix}1 & 1 \\ 1 & -1\end{pmatrix}= \begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix}[/tex] to be able to write that product in the middle.

That reduces to
[tex]\begin{pmatrix}(1/2)x'+ (1/2)y' \\ (1/2)x'- y'\end{pmatrix}= \begin{pmatrix}-1 & 0 \\ 0 & -3\end{pmatrix}\begin{pmatrix}(1/2)x+ (1/2)y \\ (1/2)x- (1/2)y\end{pmatrix}+ \begin{pmatrix}(5/2)sin(t)+ 3/2 \\ (5/2)sin(t)- 3/2\end{pmatrix}[/tex]

Now, let U= (1/2)x+ (1/2)y and V= (1/2)x- (1/2)y and that becomes
[tex]\begin{pmatrix}U' \\ V' \end{pmatrix}= \begin{pmatrix}-1 & 0 \\ 0 & -3\end{pmatrix}\begin{pmatrix}U \\ V \end{pmatrix}+ \begin{pmatrix}((1/2) sin(t)+ 3/2 \\ (1/2) sin(t)- 3/2\end{pmatrix}[/tex]
That is, we have uncoupled the two equations. We can now write them as [itex]U'= -U+ (1/2)sin(t)+ 3/2[/itex] and [itex]V'= -3V+ (1/2)sin(t)- 3/2[/itex].

Once you have solved those, of course
[tex]\begin{pmatrix}x \\ y \end{pmatrix}= \begin{pmatrix}1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix}U \\ V\end{pmatrix}[/tex]
 
  • #5
Big thanks to everybody!

I was able to get the same result. :)
 

1. What is a system of two differential equations?

A system of two differential equations is a set of two equations that involve functions and their derivatives. These equations are used to model and describe relationships between variables in various fields of science, such as physics, engineering, and biology.

2. How do you solve a system of two differential equations?

To solve a system of two differential equations, you need to use techniques such as substitution, elimination, or graphical methods. These methods involve manipulating the equations and their variables to find a solution that satisfies both equations simultaneously.

3. What are the different types of solutions for a system of two differential equations?

The solutions for a system of two differential equations can be either exact solutions or numerical solutions. Exact solutions are analytical expressions that satisfy both equations, while numerical solutions are approximations found using numerical methods.

4. Can a system of two differential equations have more than one solution?

Yes, a system of two differential equations can have multiple solutions. This is because there are often multiple sets of values for the variables that satisfy both equations. These solutions can be distinct or equivalent, depending on the nature of the equations.

5. What are some real-life applications of solving systems of two differential equations?

Solving systems of two differential equations is commonly used in many scientific fields, such as engineering, physics, and economics. It is also used in practical applications, such as modeling the spread of diseases, predicting weather patterns, and designing control systems for machines and vehicles.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
571
  • Calculus and Beyond Homework Help
Replies
10
Views
477
Replies
7
Views
523
  • Calculus and Beyond Homework Help
Replies
7
Views
285
  • Calculus and Beyond Homework Help
Replies
14
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
12
Views
1K
  • Differential Equations
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
12
Views
1K
Back
Top