弦の振動

2005/5/31 平野拓一(東京工業大学)
May 31, 2005 Takuichi Hirano (Tokyo Institute of Technology)

参考:
  (HELP) NDSolve::bcedge

初期波形: 放物線

g[x_] := x*(x - 1);
\(\(sol = 
        NDSolve[{\(\(Derivative[2, 0]\)[f]\)[x, 
                t] == \(\(Derivative[0, 2]\)[f]\)[x, t], 
		f[1, 
                t] == 0, f[x, 0] == g[x], 
            f[0, t] == 
              0, 
		\(\(Derivative[0, 1]\)[f]\)[x, 0] == 0}, 
          f, {x, 0, 1}, {t, 0, 4}];\)\)
Plot[g[x], {x, 0, 1}];
Plot3D[
        Evaluate[f[x, t] /. sol[[1]]], {x, 0, 1}, {t, 0, 
          4}];

Animation

Table[
      Plot[Evaluate[f[x, t] /. sol[[1]]], {x, 0, 
          1}, 
PlotPoints -> 
          50, 
PlotRange -> {-0.3, 0.3}], {t, 0, 
        4 - 0.001, 0.2}]

初期波形: 正弦波

g[x_] := 0.25*Sin[π*x];
\(\(sol = 
        NDSolve[{\(\(Derivative[2, 0]\)[f]\)[x, 
                t] == \(\(Derivative[0, 2]\)[f]\)[x, t], 
		f[1, 
                t] == 0, f[x, 0] == g[x], 
            f[0, t] == 
              0, 
		\(\(Derivative[0, 1]\)[f]\)[x, 0] == 0}, 
          f, {x, 0, 1}, {t, 0, 4}];\)\)
Plot[g[x], {x, 0, 1}];
Plot3D[
        Evaluate[f[x, t] /. sol[[1]]], {x, 0, 1}, {t, 0, 
          4}];

Animation

Table[
      Plot[Evaluate[f[x, t] /. sol[[1]]], {x, 0, 
          1}, 
PlotPoints -> 
          50, 
PlotRange -> {-0.3, 0.3}], {t, 0, 
        4 - 0.001, 0.2}]