Métodos analíticos de resolución de la Ecuación de Onda (1D, 2D y 3D) 🌊
Sesión 1 (05.12.2022)
Se resuelve el problema de valor inicial de la ecuación de la onda 1D
y se deduce la fórmula de D'Alembert
Grabación
Los programas los puede encontrar en modo de snippets expandiendo aquí.
MATLAB / Octave
#!/usr/bin/env -S octave -qf
% mifi.m
function y = mifi(x)
if (-1 <= x) && (x <= 1)
y = 2 -2 * abs(x);
else
y = 0;
end
end
#!/usr/bin/env -S octave -qf
% SolDAlambert.m
clc, close all
x = -5.0:0.01:5;
u = zeros(1, 1001);
conta = 1;
figure(1)
for t = 0:0.5:3
x1 = x + t;
x2 = x - t;
for i = 1:1001
u(i) = 0.5 * (mifi(x1(i)) + mifi(x2(i)));
end
subplot(7, 1, conta)
plot(x, u), grid on
axis([-5, 5, -1, 3])
conta = conta + 1;
end
%% animación
clear x t u
x = -5.0:0.01:5; u = zeros(1, length(x));
figure(2)
for t = 0:0.1:3
clf
x1 = x + t;
x2 = x - t;
for i = 1:1001
u(i) = 0.5 * (mifi(x1(i)) + mifi(x2(i)));
end
plot(x, u), hold on
plot(x, zeros(1, length(x)), 'k')% añade un eje central a cada ploteo
axis([-5, 5, -1, 3]), hold off
pause(0.4)
end
Python
Tomado de cpp-review-dune/python
.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
class Wave1D:
def __init__(self) -> None:
self.X = np.linspace(start=-5, stop=5, num=1001)
self.T = np.linspace(start=0, stop=3, num=7)
varphi = lambda X: np.piecewise(
x=X,
condlist=[abs(X) <= 1, abs(X) >= 1],
funclist=[lambda t: 2 - 2 * abs(t), 0],
)
self.u = lambda X, t: 0.5 * (varphi(X + t) + varphi(X - t))
self.fig, self.ax = plt.subplots()
self.yy = [self.u(t, self.X) for t in self.T]
def make_plot(self):
fig, axs = plt.subplots(
nrows=self.T.size,
ncols=1,
clear=True,
constrained_layout=True,
)
for ax, t in zip(axs, self.T):
ax.plot(self.X, self.u(self.X, t), lw=1)
plt.savefig("wave.png", dpi=300)
plt.close()
def update(self, t):
self.ax.clear()
self.ax.plot(self.X, self.yy[t])
self.ax.set_xlim((self.X[0], self.X[-1]))
self.ax.set_ylim((np.min(self.yy), np.max(self.yy)))
self.ax.set_title(f"t = {self.T[t]:.2f}")
self.ax.grid(True)
def make_animation(self):
anim = FuncAnimation(
fig=self.fig, func=self.update, frames=self.T.size, interval=4000
)
anim.save(filename="wave1d.mp4", writer="ffmpeg", fps=60, dpi=300)
if __name__ == "__main__":
Wave1D().make_plot()
Wave1D().make_animation()
Sesión 2 (12.12.2022)
Se define el dominio de dependencia e intervalo de dependencia.
Se exhibe que la energía total de un sistema se conserva, es decir, , donde
El problema de valor inicial de la ecuación de la onda en el caso no homogéneo es
Donde y su solución es
Se estudia el principio de Duhamel que establece
Grabación
Sesión 3 (16.12.2022)
Grabación
Referencias
- Partial Differential Equations: Second Edition by Lawrence C. Evans
- Advanced Modern Engineering Mathematics by Glyn James
- Advanced Engineering Mathematics by Dennis Zill
- Advanced Engineering Mathematics by Peter V. O'Neil
- Advanced Engineering Mathematics by Erwin Kreyszig
- Partial Differential Equations: A First Course by Rustum Choksi
- Partial Differential Equations: An Accessible Route through Theory and Applications by András Vasy
- Introduction to Partial Differential Equations with MATLAB
- An Introduction to Partial Differential Equations with MATLAB by Matthew P. Coleman. Páginas 54-58, 62-65, 138-146, 155, 157, 159-160, 195-201, 250, 378-380, 390-397, 414-421, 439-455, 556, 588, 593, 596-597.
- Lecture notes based on L.C.Evans’s textbook, by Baisheng Yan. Páginas 65-82.
- Math 124A/215A by Viktor Grigoryan. Páginas 1-7, 1-4, 1-4, 1-4, 1-4, 1-4, 1-4, 1-4.
- Vector Analysis and an introduction to tensor analysis by Murray R. Spiegel
- A first course in partial differential equations by Russell L. Herman
- Applied Partial Differential Equations by J. David Logan
- Fundamentals of Differential Equations by R. Kent Nagle
- Partial Differential Equations in Action by Sandro Salsa
- Partial Differential Equations: An Introduction by Walter A. Strauss
- Numerical Models for Differential Problems by Alfio Quarteroni
- Fourier Analysis: An introduction by Elias M. Stein and Rami Shakarchi
- A first course in Partial Differential Equations with complex variables and transform methods by H. F. Weinberger