RowBox[{              &n ...                                                                                            t    xx

1. 差分法による解法

RowBox[{( 1 ), f, (x), StyleBox[Cell[], FontSize -> 14., FontColor -> RGBColor[1., 0., 0.]], のグラフ}]

In[1]:=

Clear[f] ; f[x_] := x /; 0 <= x <= 1/2 ; f[x_] := 1 - x /; 1/2 <= x <= 1 ; Plot[f[x], {x, 0, 1}, PlotStyle -> Hue[0.0]]

[Graphics:HTMLFiles/15answer(report2)_5.gif]

Out[1]=

-Graphics -

( 2 ) 対応する差分方程式

                                                                                               ... t;   0                          ρ                     1 - 2 ρ               U (i, n - 1)

( 3 ) 初期条件

初期条件を v[n]  として定義します.

In[2]:=

Clear[v] ; v[n_] := Table[f[k/n], {k, 1, n - 1}] ; v[8]

Out[2]=

{1/8, 1/4, 3/8, 1/2, 3/8, 1/4, 1/8}

( 4 ) 差分スキームの構成

RowBox[{, RowBox[{上の行列を,  , A, (m, n), StyleBox[Cell[], FontSize -> 16., FontColor -> RGBColor ... l[], FontColor -> RGBColor[1., 0., 0.]]}], StyleBox[Cell[], FontColor -> RGBColor[1., 0., 0.]]}]}]

In[4]:=

Clear[o, z] ; o[x_] = 0 ; z[n_] := Array[o, n - 4] ; z[8] ;

In[5]:=

Clear[k] ; k[m_, n_] := (n^2)/m ;

In[6]:=

Clear[r] ; r[m_, n_, i_] := Insert[Insert[Insert[z[n], k[m, n], i - 1], 1 - 2 k[m, n], i], k[m, n], i + 1] ; r[10, 6, 2] ;

In[7]:=

Clear[rf] ; rf[m_, n_] := Insert[Insert[Insert[z[n], 1 - 2 k[m, n], 1], k[m, n], 2], 0, 3] ; rf[10, 6] ;

In[10]:=

Clear[rl] ; rl[m_, n_] := Insert[Insert[Insert[z[n], 0, n - 3], k[m, n], n - 2], 1 - 2 k[m, n], n - 1] ; rl[10, 6] ;

In[11]:=

Clear[M] ; M[m_, n_] := {rf[m, n], Table[r[m, n, i], {i, 2, n - 2}], rl[m, n]} ; M[10, 6] ;

In[12]:=

A[m_, n_] := Partition[Flatten[M[m, n]], n - 1] ;

RowBox[{             , RowBox ... owBox[{4 ,n, =, RowBox[{5,   , の場合, Cell[]}]}]}], FontColor -> RGBColor[0., 0., 1.]]}]}]

In[13]:=

A[4, 5] // MatrixForm

Out[13]//MatrixForm=

(  23   25              )   ---   --    2    4     0     0    25     23   25   --    ---   --  ...   --   0     4      2    4                25     23               --    ---   0     0     4      2

StyleBox[RowBox[{近似解 U (m, n, s), =, RowBox[{{U (s, 1), ···, U (s, n - 1)}, Cell[],  , の定義}]}], FontSize -> 16., FontColor -> RGBColor[0., 0., 1.]]

In[19]:=

Clear[L] ; L[m_, n_, s_] := MatrixPower[A[m, n], s] ; L[35, 4, 5] ;

In[20]:=

Clear[u] ; u[m_, n_, s_] := L[m, n, s] . v[n] ;

In[21]:=

L[3, 4, 1] // MatrixForm ;

In[22]:=

L[3, 4, 1] . v[4] ;

In[23]:=

{u[3, 4, 0], u[3, 4, 1], u[3, 4, 2]}

Out[23]=

{{1/4, 1/2, 1/4}, {1/4, -13/6, 1/4}, {-503/36, 425/18, -503/36}}

                                                                            1             s Ro ...                                                                      100      2      で上の条件が満たされる.

In[24]:=

U[m_, n_, s_] := Insert[Insert[u[m, n, s], 0, n], 0, 1] ; U[100, 6, 3]

Out[24]=

{0, 14167/93750, 12466/46875, 9559/31250, 12466/46875, 14167/93750, 0}

                                                                                               ... [Cell[BoxData[u (t, x)]]]], の挙動,  , を見る.}], FontSize -> 18., FontColor -> RGBColor[1., 0., 1.]]}]

                                                                                               ...                                                                                                100

In[25]:=

ListPlot[U[100, 6, 1], PlotJoined -> True, PlotStyle -> Hue[0.0], PlotRange -> {0, 0.5}]

[Graphics:HTMLFiles/15answer(report2)_38.gif]

Out[25]=

-Graphics -

RowBox[{RowBox[{(6),  , StyleBox[Cell[TextData[{n=6,, Cell[BoxData[m = 100]]}]], FontSize -> 1 ... tData[Cell[BoxData[u (t, x)]]]], の近似グラフです.}], FontSize -> 16., FontColor -> RGBColor[1., 0., 1.]]

In[26]:=

Do[ListPlot[U[100, 6, t], PlotJoined -> True, PlotStyle -> Hue[0.0], PlotRange -> {0, 0.5}], {t, 0, 20}]

[Graphics:HTMLFiles/15answer(report2)_42.gif]

[Graphics:HTMLFiles/15answer(report2)_43.gif]

[Graphics:HTMLFiles/15answer(report2)_44.gif]

[Graphics:HTMLFiles/15answer(report2)_45.gif]

[Graphics:HTMLFiles/15answer(report2)_46.gif]

[Graphics:HTMLFiles/15answer(report2)_47.gif]

[Graphics:HTMLFiles/15answer(report2)_48.gif]

[Graphics:HTMLFiles/15answer(report2)_49.gif]

[Graphics:HTMLFiles/15answer(report2)_50.gif]

[Graphics:HTMLFiles/15answer(report2)_51.gif]

[Graphics:HTMLFiles/15answer(report2)_52.gif]

[Graphics:HTMLFiles/15answer(report2)_53.gif]

[Graphics:HTMLFiles/15answer(report2)_54.gif]

[Graphics:HTMLFiles/15answer(report2)_55.gif]

[Graphics:HTMLFiles/15answer(report2)_56.gif]

[Graphics:HTMLFiles/15answer(report2)_57.gif]

[Graphics:HTMLFiles/15answer(report2)_58.gif]

[Graphics:HTMLFiles/15answer(report2)_59.gif]

[Graphics:HTMLFiles/15answer(report2)_60.gif]

[Graphics:HTMLFiles/15answer(report2)_61.gif]

[Graphics:HTMLFiles/15answer(report2)_62.gif]

2. フーリエによる解析的な方法による解法

                                                                                       2       ...                                                                                                  m

In[27]:=

Clear[b] ; b[m_] := 2 (∫ _ 0^(1/2) x * Sin[m * π * x] d x + ∫ _ (1/2)^1 (1 - x) * Sin[m * π * x] d x) ; b[m]

Out[27]=

2 ((2 Sin[(m π)/2])/(m^2 π^2) - Sin[m π]/(m^2 π^2))

フーリエ係数は RowBox[{  , StyleBox[RowBox[{Cell[TextData[{Cell[BoxData[b  =]],  }]], 4/(m  ... , 1.]], は以下のようになる.}]                                                                            m

In[28]:=

Table[b[k], {k, 1, 10}]

Out[28]=

{4/π^2, 0, -4/(9 π^2), 0, 4/(25 π^2), 0, -4/(49 π^2), 0, 4/(81 π^2), 0}

                                                                                               ...                                                                                         (m π)


Converted by Mathematica  (January 22, 2004)