Übung - Lineare gewöhnliche Differentialgleichungen 2. Ordnung

Code
import numpy as np
import matplotlib.pyplot as plt
import sympy as sp

Aufgaben

Aufgabe LDG2-1: Lineare DGL 2. Ordnung

Lösen Sie die Differentialgelichung \(\ddot{y} + 3\dot{y} + 2y = 0\) mit den Anfangsbedingungen \(y(0)=2\) und \(\dot{y}(0)= -3\) von Hand und überprüfen Sie Ihr Ergebnis am Computer symbolisch.

Aufgabe LDG2-2: Lineare DGL 2. Ordnung

Bestimmen Sie die Lösungen folgender GDGL bzw. Anfangswertprobleme. Beschreiben Sie die Lösungen und deren Verhalten für \(x \rightarrow \infty\).

  1. \(y''(x) + 5y'(x) - 6y(x) = 0\)
  2. \(y''(x) - y(x) = 0\), \(y(0)=1\) und \(y'(0)= 0\)

Quelle: Farlow: An Introduction to Differential Equations and their Applications. Sec. 3.4., Example 1, p. 131f.

Aufgabe LDG2-3: Lineare DGL 2. Ordnung

Wir betrachten die GDGL \(y''(x) - 2y'(x) + y(x) = e^{3x}\).

  1. Zeigen Sie, dass \(\frac{1}{4}e^{3x}\) eine partikuläre Lösung ist.
  2. Bestimmen Sie die allgemeine Lösung.

Quelle: Bronson: Differential Equations. 4. Auflage, Aufgabe 8.23, S. 79.

Aufgabe LDG2-4: Lineare DGL 2. Ordnung

Bestimmen Sie die Lösungen folgender Anfangswertprobleme und beschreiben Sie die Lösungen und deren Verhalten für \(x \rightarrow \infty\)

  1. \(y''(x) + 6y'(x) + 9y(x) =0\), \(y(0)=1\) und \(y'(0)= 2\)
  2. \(y''(x) + 8y'(x) + 20y(x) =0\), \(y(0)=1\) und \(y'(0)= 6\)

Quelle: Dietmaier, p. 474, Aufgaben 12.9 b) und c)

Lösungen

Lösung LDG2-1: Lineare DGL 2. Ordnung

\(y(t) = e^{-t} + e^{-2t}\)

Code
sp.init_printing()

t = sp.symbols('t')
y = sp.symbols('y', cls=sp.Function)
diffeq = sp.Eq(y(t).diff(t).diff(t) + 3*y(t).diff(t) + 2*y(t), 0) 
diffeq

\(\displaystyle 2 y{\left(t \right)} + 3 \frac{d}{d t} y{\left(t \right)} + \frac{d^{2}}{d t^{2}} y{\left(t \right)} = 0\)

Code
ys = sp.dsolve(diffeq, y(t))
ys

\(\displaystyle y{\left(t \right)} = \left(C_{1} + C_{2} e^{- t}\right) e^{- t}\)

Code
sp.init_printing(False)

Lösung LDG2-2: Lineare DGL 2. Ordnung

  1. \(y(x) = c_1 e^{-6x} + c_2 e^{x}\)
  2. \(y(x) = \cosh(x)\)

Lösung LDG2-3: Lineare DGL 2. Ordnung

  1. durch Einsetzen
  2. \(y(x) = c_1 e^x + c_2 xe^x + \frac{1}{4}e^{3x}\)

Lösung LDG2-4: Lineare DGL 2. Ordnung

  1. \(y(x) = e^{-3x}(c_1 + c_2 x) = e^{-3x}(1 + 5x)\)
  2. \(y(x) = e^{-4x}(c_1 \cos(2x) + c_2\sin(2x)) = e^{-4x}(\cos(2x) + 5\sin(2x))\)
Code
x = np.linspace(0,3, 100)
y = np.exp(-3*x)*(1 + 5*x)

plt.figure(figsize=(6,3))
plt.plot(x, y,'-r')
plt.xlabel('x')
plt.ylabel('y')
plt.grid(True)

Code
x = np.linspace(0,3, 100)
y = np.exp(-4*x)*(np.cos(2*x) + 5*np.sin(2*x))

plt.figure()
plt.plot(x, y,'-r')
plt.xlabel('x')
plt.ylabel('y')
plt.grid(True)
print(np.min(y))
-0.0024990299146947434