Mathematica Workbook Workbook Mathematica Mathematica A4 12 A5 9 14 4 2
Chapter 3 Mathematica Mathematica e a n = ( 1 + 1 ) n b n = 1 + 1 n 1! + 1 2! + + 1 n! b n a n e 3/n b n e 2/n! b n a n b n M athematica 10 3.7 3.1 Mathematica { } {a, b, c} {{a, b}, {c, d}} {Sin[x], Cos[x], Tan[x]} [1] v1 v2 In[1]:= v1 = {a, b, c}; v2 = {p, q, r}; [2] v1 v2 In[2]:= v1 + v2
22 3 [3] In[3]:= 100*v1 [4] 1 : In[4]:= v1 + 1 [5] x : In[5]:= x - v1 [6] 3 In[6]:= v1^3 [7] 5 In[7]:= 5^v1 [8] In[8]:= Exp[v1] [9] In[9]:= v1^v2 [10] In[10]:= v1*v2 [11] In[11]:= v1/v2 [12] In[12]:= v1.v2 3.1 u = {1, 2, 3, 4, 5} x { 1 3 1, 2 3 2, 3 3 3, 4 3 4, 5 3 5 }, { x, x 2 2!, x 3 3!, x 4 4!, x 5 } 5! n n! Factorial[n]
3.2 23 3.2 Range [13] Range {1, 2, 3, 4, 5} In[13]:= Range[5] [14] Range {4, 5,..., 10} In[14]:= Range[4, 10] [15] Range 4 x 10 0.7 In[15]:= Range[4, 10, 0.7] 4 0.7 10 Table [16] Table (square numbers) sq In[16]:= sq = Table[n^2, {n, 1, 10}] Table[..] n 1 10 1 n^2 Table [17] [[ ]] sq 7 In[17]:= sq[[7]] [18] Length sq In[18]:= Length[sq] 3.2 (e ) Table e a n = ( 1 + 1 ) n n 10 N an
24 3 3.3 ( ) Table x 1, x 2 1,, x 10 1 3.4 ( ) mat = {m,a,t,h,e,m,a,t,i,c,a} tam Table (Hint tam n mat ) 3.3 [19] m1 *1 In[19]:= m1 = {{a, b, c}, {p, q, r}}; [20] MatrixForm m1 (matrix) In[20]:= m1 //MatrixForm MatrixForm[m1] * 2*3 [19] m1 [21] TableForm m1 (table) In[21]:= m1 //TableForm TableForm[m1] [22] Table In[22]:= m2 = Table[i + j, {i, 1, 4}, {j, 1, 5}] [23] TableForm *1 [1] v1 = {a, b, c} v2 = {p, q, r} m1 = {v1, v2} *2 Sin[x] x//sin TableForm MatrixForm *3 MatrixForm 2*m1 2 2*MatrixForm[m1] TableForm
3.4 25 In[23]:= m2 //TableForm m2 [22] {i, 1, 4} {j, 1, 5} [24] [[ ]] 2 5 In[24]:= m2[[2, 5]] 3.5 ( ) TableForm 1 9 1 19 3.6 ( ) 1 10 2 3 3.4 Mathematica Sum [25] Sum 1 10 2 In[25]:= Sum[n^2, {n, 1, 10}] 10 n=1 n 2 [16] sq = Table[n^2, {n, 1, 10}] Table Sum [26] Mathematica 2 In[26]:= Sum[k^2, {k, 1, n}] [27] 1 + 1/2 2 + 1/3 2 + In[27]:= Sum[1/n^2, {n, 1, Infinity}] Infinity [28] 8 *4 *4 Sum[x^n/n!, {n, 0, Infinity}] Exp[x]
26 3 In[28]:= Sum[x^n/n!, {n, 0, 8}] [29] Product 1 19 10 n=1 In[29]:= Product[2*n - 1, {n, 1, 10}] (2n 1) [30] 3.5 In[30]:= Sum[m * n, {m, 1, 9}, {n, 1, 9}] 3.7 ( ) e a n = (1) Sum b 5 ( 1 + 1 ) n b n = 1 + 1 n 1! + 1 2! + + 1 n! (2) Table b n 10 bn (3) bn 3.2 an a n, a n e, b n, b n e x Abs[x] Sum 3.8 ( ) Mathematica 100 3 (1). k + k 1 99 k=2 (2) 2 2 2 1, 2 3 2 1, 2 4 2 1,... n 00 (3) m 1, 3, 5,..., 2m 1 2 m C 2 99
3.5 27 3.5 Mathematica (1) i 1 m j 1 n i + j 1 i m,1 j n (i + j) (2) i, j, k 1 n i + j + k 1 i,j,k n (i + j + k) (3) 4 8 n S n S 99 S 100 S 1 S 100 S n 92 (Hint: S n 1 + log 10 S n x Floor[x] ) (4)
Chapter 14 3 1 1 13 14.1 (dynamical system) a n+1 = 2a n ; a 0 = 1. a n = 2 n f(x) = 2x a n+1 = f(a n ) a 1 = f(a 0 ), a 2 = f(f(a 0 )) a 3 = f(f(f(a 0 ))) f a 0 1 3 *1 {a n } R 0, ±1, ±2, x 1 f(x) = 2x *1 3
138 14 R f (dynamical system) *2 x 0 R x 0 f f(x 0 ) f f(f(x 0 )) f x 0 f 2x 0 f 2 2 x 0 f x 0 (orbit) {a n } a 0 = 1 f f f f f n f n {f n (x 0 )} *3 f f(x) 2 f 10 (x) x 1024 Mathematica 14.2 p y = f(x) p f(p) f(f(p)) f(f(f(p)))... y = f(x) xy (p, p) (f(p), f(p)) Step 0 y = f(x) y = x Step 1 (p, p) y = f(x) (p, f(p)) Step 2 (p, f(p)) y = x (f(p), f(p)) Step 1 2 y = x p 14.1 (graphical analysis) web diagram f(x) = 2x x 0 = ±1/4 14.2 Mathematica ListLinePlot Show *2 (discrete dynamical system) *3 f n (x) f f f f(x) f(x) n {f(x)} n
14.2 139 y y = x f(p) p y = f(x) O p f(p) x 14.1 f(x) (p, p) (f 2 (p).f 2 (p)) 2 6 4 5 4 3 2 1 1 2 2 2 4 2 1 1 2 3 4 5 6 2 14.2 f(x) = 2x x 0 = 1/4 x 0 = 1/4 [1] Step 0 y = f(x) = 2x y = x In[1]:= f[x_] := 2 x; gr = Plot[{f[x], x}, {x, -2, 8}, AspectRatio -> Automatic] [2] Step 1 Step 2 (p, p) (p, f(p)) (f(p), f(p)) In[2]:= tateyoko[p_] := {{p, f[p]}, {f[p], f[p]}}; [3] p n
140 14 In[3]:= weblist[p_, n_] := (w = {{p, p}}; x = p; Do[(w = Join[w, tateyoko[x]]; x = f[x]), {i, 1, n}]; w); [4] In[4]:= weblist[1/2, 3] [5] In[5]:= webdiag[p_, n_] := ListLinePlot[weblist[p, n], PlotStyle -> Thick, AspectRatio -> Automatic, PlotRange -> All]; PlotRange -> All [6] In[6]:= webdiag[1/2, 3] [7] Show In[7]:= Show[gr, webgr[1/2, 3]] [8] Manipulate p n In[8]:= Manipulate[Show[gr, webgr[p, n]], {{p, 1}, -1, 4}, {{n, 3}, 0, 10, 1}] n 14.1 ( ) 2 g a (x) = ax(1 x) 0 a 4 [0, 1] [0, 1] Manipulate a 14.2 ( ) 1 (1)
14.3 141 (2) y = x 14.3 f(x) f(x) = 0 (Newton s method) (1) y = f(x) (2) x 0 (x 0, f(x 0 )) (3) x (x 1, 0) x 0 f(x) = 0 α x 1 α *4 (x 1, f(x 1 )) x 1 = x 0 f(x 0 )/f (x 0 ) N f (x) := x f(x) f (x) N f x 0 N f x1 = N f (x 0 ) N f f x 2 = N f (x 0 ) α N f f 14.3 *4 f C 2
142 14 [9] f(x) = x 2 2 2 f In[9]:= f[x_] = x^2-2; df[x_] = D[f[x], x]; newton[x_] = x - f[x]/df[x] N f (x) = x2 + 2 2x [10] NestList x 0 = 1 x 0, x 1,..., x 5 In[10]:= app = NestList[newton, 1, 5] [11] 20 In[11]:= N[app, 20] //TableForm TableForm [12] Sqrt[2] *5 In[12]:= N[{app, app - Sqrt[2]}, 20] //Transpose//TableForm [13] In[13]:= seg[p_] := {{p, f[p]}, {newton[p], 0}}; seglist[p_, n_] := (w = {{p, 0}}; x = p; *5 Transpose[N[{app, app - Sqrt[2]}, 20]] //TableForm TableForm[N[{app, app - Sqrt[2]}, 20], TableDirections -> Row]
14.4 143 Do[ (w = Join[w, seg[x]]; x = newton[x]), {i, 1, n}]; w); seggr[p_, n_] := ListLinePlot[seglist[p, n], PlotRange -> All, PlotStyle -> Thick] gr = Plot[f[x], {x, -5, 5}]; Manipulate[ Show[gr, seggr[p, n]], {{p, 5}, -5, 5}, {{n, 3}, 1, 10, 1}] p 2 p 2 * 6 1 3 14.3 ( ) 3 g a (x) = x 3 3x + a (a > 0) Manipulate a a g a (x) = 0 a p n 10 5 2 2 4 5 14.4 C f(z) 1 (complex dynamics) f(z) f c (z) = z 2 + c (c C) 2 f c c C *6 p 0 f
144 14 f c z f n c (z) (n ) *7 B c := {z C f n c (z) (n )} c f c (basin at infinity) B c K c := C B c (filled Julia set) B c K c f c (Julia set) J c J c Mathematica * 8 c 2 z C fc k (z) 2 k fc k+n (z) n B c (k) := { z C f k c (z) 2 } B c (1) B c (2) B c = k 1 B c(k) k B c (k) B c k = 50 [14] c = 0.122 + 0.745i B c K c f c *7 z 2 + c f c (z) 2 z f(z) = z 2 + c z z c (2+ c ) z c 2 z + c ( z 1) 2 z + c (1+ c ) 2 z. f n (z) 2 n z (n ) z max{2, c } f n (z) (n ) *8 Mathematica C Java Mathematica C
14.4 145 In[14]:= c = -0.122 + 0.745 I; f[z_] := z^2 + c; [15] B c In[15]:= col[z_] := (p = z; k = 0; While[(Abs[p] < 2.0) && (k < 50), (p = f[p]; k = k + 1)]; k) While f c k (z) < 2 k < 50 (...) p = f[p]; k = k + 1 k f k c (z) 2 k 49 k = 50 f k c (z) < 2 col 0 50 49 z B c 50 z K c [16] {x + yi 2 x 2, 2 y 2} d = 0.01 Table col In[16]:= d = 0.01; tab = Table[col[x + y I], {x, -2, 2, d}, {y, -2, 2, d}]; * 9 [17] tab ArrayPlot complexap (complex Array Plot ) 14.4 In[17]:= complexap[t_] := ArrayPlot[Reverse[Transpose[t]]]; *9 400 400 = 160000 col col 50 d
146 14 14.4 complexap d col tab Transpose Reverse ArrayPlot [18] tab complexap In[18]:= complexap[tab] col B c K c 14.4 ( ) B c c 14.6. f c z = 0 f c(z) = 0 z = 0 f c z = 0 0 B c c H := {c C fc n (0) (n )} M := C H
14.4 147 14.5 ColorFunction "LightTemperatureMap" "MintColors", "WatermelonColors" "RedBlueTones". 14.6 c = 1 c = i, 0.22 + 0.65i c = 0.25.
148 14 (the Mandelbrot set) * 10 14.5 ( ) complexap2 M. f(z) = z 3 1 = 0 z 0 N f (z) 2 1 3 N f (z) f f, df, newton d = 0.01; f[x_] = x^3-1; df[x_] = D[f[x], x] newton[x_] := x - f[x]/df[x]; coln[z_] := (p = z; k = 0; While[(Abs[p^3-1] > 0.1) && (k < 50), (p = newton[p]; k = k + 1)]; k) tabn = Table[colN[x + y I], {x, -2, 2, d}, {y, -2, 2, d}]; complexap2[tabn] *10 K c c
14.5 149 14.5 (1) R. Devaney 2 (2) 2 http://www.math.nagoya-u.ac.jp/~kawahira/courses/mandel.pdf