You are on page 1of 4

In[55]:= m=2

k=8
x0 = 0.1
v0 = 0.5
DSolve[m x ''[t] + k x[t] ⩵ 0, x[t], t]
Out[55]= 2

Out[56]= 8

Out[57]= 0.1

Out[58]= 0.5

Out[59]= {{x[t] → C[1] Cos[2 t] + C[2] Sin[2 t]}}

In[63]:= Sol1 = DSolve[{m x ''[t] + k x[t] ⩵ 0, x[0] ⩵ x0, x '[0] ⩵ v0}, x[t], t]
xsol = x[t] /. Sol1[[1]] // Expand
Out[63]= {{x[t] → 0.1 Cos[2 t] + 0.25 Sin[2 t]}}

Out[64]= 0.1 Cos[2 t] + 0.25 Sin[2 t]


2 Tarea 2 Movimiento armónico simple.nb

In[65]:= Plot[xsol, {t, 0, 10}, PlotRange → All,


PlotLabel → "Desplazamiento", AxesLabel → {"t[seg]", "x[m]"}]
Plot[xsol, {t, 0, 20}, PlotRange → All, PlotLabel → "Desplazamiento",
AxesLabel → {"t[seg]", "x[m]"}]
Desplazamiento
x[m]
0.3

0.2

0.1
Out[65]=
t[seg]
2 4 6 8 10

-0.1

-0.2

Desplazamiento
x[m]
0.3

0.2

0.1
Out[66]=
t[seg]
5 10 15 20

-0.1

-0.2

In[67]:= xsol[[1]]
xsol[[2]]
Out[67]= 0.1 Cos[2 t]

Out[68]= 0.25 Sin[2 t]

In[73]:= Amplitud = xsol[[1, 1]]2 + xsol[[2, 1]]2


xsol[[1, 1]]
ϕd = ArcTan 
xsol[[2, 1]]
k
ωn =
m

Out[73]= 0.269258

Out[74]= 0.380506

Out[75]= 2
Tarea 2 Movimiento armónico simple.nb 3

In[76]:= Envolvente1 = + Amplitud


Envolvente2 = - Amplitud
Out[76]= 0.269258

Out[77]= - 0.269258

In[78]:= Plot[{xsol, Envolvente1, Envolvente2}, {t, 0, 20}, PlotStyle → {Red, Dashed, Dashed},
PlotRange → All, PlotLabel → "Desplazamiento", AxesLabel → {"t[seg]", "x[m]"}]
Desplazamiento
x[m]
0.3

0.2

0.1

Out[78]=
t[seg]
5 10 15 20

-0.1

-0.2

In[79]:= xsol2 = Amplitud Sin[ωn t + ϕd]


Out[79]= 0.269258 Sin[0.380506 + 2 t]
4 Tarea 2 Movimiento armónico simple.nb

In[80]:= Plot[{xsol, xsol2, Envolvente1, Envolvente2}, {t, 0, 10},


PlotStyle → {Red, {Blue, Dashed}, {Red, Dashed}, {Red, Dashed}},
PlotRange → All, PlotLabel → "Desplazamiento", AxesLabel → {"t[seg]", "x[m]"}]
Desplazamiento
x[m]
0.3

0.2

0.1

Out[80]=

2 4 6 8 10

-0.1

-0.2

You might also like