You are on page 1of 4

Ecuacion de onda

∂xx U ⩵ a2 ∂tt U

Clear[C1, C2, C3, C4, λ]


F[x_, t_] := X[x] T[t]
T[t_] := C1 Sin[λ t] + C2 Cos[λ t]
λ λ
X[x_] := C3 Sin x + C4 Cos x
a a
F[x, t]

D[F[x, t], t]
D[F[x, t], x]
D[F[x, t], {x, 2}]
D[F[x, t], {t, 2}]

∂x,t F[x, t]
∂t,x F[x, t]

∂x,t F[x, t]

∂x,x F[x, t] ⩵ a2 ∂t,t F[x, t]

a2 ∂x,x F[x, t] ⩵ ∂t,t F[x, t] // Expand

F[x, t]

CF1 = F[0, t] ⩵ 0
CF2 = 0 ⩵ (∂x,x F[x, t]) /. x → L
Solve[CF1]

CF3 = ∂t,t F[0, t] ⩵ 0


CF4 = 0 == (∂t F[x, t]) /. t → 0

Solve[{CF1, CF2, CF3, CF4}, {C1, C2, C3, C4, λ}]

Ec1 = X[0] ⩵ 0
Ec2 = X[L] ⩵ 0

Sol = Solve[{Ec1, Ec2}]

Clear[λ]

Sol1 = SolveSin  ⩵ 0, λ
a
λ = λ /. Sol1[[2]]
anπ
λ=
L
C4 = 0
2 Tarea 20 Ecuacion de onda.nb

F[x, t] // Expand
F[x, t] // Expand /. C2 C3 → an, C2 C1 → bn

anπt nπx anπt nπx


Fi[x_, t_] := an Cos  Sin  + bn Sin  Sin  // Simplify
L L L L
Fi[x, t]

Fi[x, t] == OndaIni /. t → 0
∂t Fi[x, t] ⩵ VelIni /. t → 0

F[x, t] == OndaIni /. t → 0
∂t F[x, t] ⩵ VelIni /. t → 0

L=1
πx
OndaIni1 = 0.05 Sin 
L
L
OndaIni = UnitStep[x] - UnitStepx -  0.1 x +
2
L
UnitStepx -  - UnitStep[x - L] - 0.1 x + 0.1
2
Plot[{OndaIni}, {x, 0, L}, AspectRatio → Automatic]

Plot[OndaIni1, {x, 0, L}, AspectRatio → Automatic]

VelIni = 0

Analizando los modos


a=1
F1 = Fi[x, t] /. {an → 0.05, bn → 0} /. n → 1

Table[Plot[F1, {x, 0, L}, AspectRatio → Automatic, PlotRange → {- 0.2, 0.2}],


{t, 0, 10, 0.1}];
ListAnimate[
%]
Tarea 20 Ecuacion de onda.nb 3

2πx
OndaIni2 = 0.03 Sin 
L
a=1
F2 = Fi[x, t] /. {an → 0.03, bn → 0} /. n → 2

Table[Plot[F2, {x, 0, L}, AspectRatio → Automatic, PlotRange → {- 0.2, 0.2}],


{t, 0, 10, 0.1}];
ListAnimate[
%]

3πx
OndaIni3 = - 0.03 Sin 
L
a=1
F3 = Fi[x, t] /. {an → - 0.03, bn → 0} /. n → 3
Table[Plot[F3, {x, 0, L},
AspectRatio → Automatic, PlotRange → {- 0.2, 0.2}], {t, 0, 10, 0.1}];
ListAnimate[
%]
4πx
OndaIni4 = - 0.01 Sin 
L
a=1
F4 = Fi[x, t] /. {an → - 0.01, bn → 0} /. n → 4
Table[Plot[F4, {x, 0, L},
AspectRatio → Automatic, PlotRange → {- 0.2, 0.2}], {t, 0, 10, 0.1}];
ListAnimate[
%]

F1 + F2 + F3 + F4

Table[Plot[F1 + F2 + F3 + F4, {x, 0, L},


AspectRatio → Automatic, PlotRange → {- 0.2, 0.2}], {t, 0, 10, 0.1}];
ListAnimate[
%]

Series de Fourier

Clear[Y, k]

an = IntegrateOndaIni Sin x, x, Assumptions -> n ∈ Integers
L
bn = 0

a=2
4 Tarea 20 Ecuacion de onda.nb

∞ nπ nπa nπa
Y =  Sin x an Cos t + bn Sin t
n=1 L L L

Table[Plot[Y, {x, 0, L}], {t, 0, 10}]

Y[x, t, 20]

You might also like