Microsoft Word - 資料 (テイラー級数と数値積分).docx

Similar documents
Microsoft Word - 03-数値計算の基礎.docx

Microsoft Word - 資料 docx

情報活用資料

. (.8.). t + t m ü(t + t) + c u(t + t) + k u(t + t) = f(t + t) () m ü f. () c u k u t + t u Taylor t 3 u(t + t) = u(t) + t! u(t) + ( t)! = u(t) + t u(

情報活用資料

3. :, c, ν. 4. Burgers : u t + c u x = ν 2 u x 2, (3), ν. 5. : u t + u u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,.,

3. :, c, ν. 4. Burgers : t + c x = ν 2 u x 2, (3), ν. 5. : t + u x = ν 2 u x 2, (4), c. 2 u t 2 = c2 2 u x 2, (5) (1) (4), (1 Navier Stokes,., ν. t +

(2-1) x, m, 2 N(m, 2 ) x REAL*8 FUNCTION NRMDST (X, M, V) X,M,V REAL*8 x, m, 2 X X N(0,1) f(x) standard-norm.txt normdist1.f x=0, 0.31, 0.5

num3.dvi

演習2

Fortran90/95 [9]! (1 ) " " 5 "Hello!"! 3. (line) Fortran Fortran 1 2 * (1 ) 132 ( ) * 2 ( Fortran ) Fortran ,6 (continuation line) 1

情報処理概論(第二日目)

num2.dvi

all.dvi

joho09.ppt

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in

Microsoft PowerPoint - NA03-09black.ppt

演習1

05 I I / 56

³ÎΨÏÀ

1 u t = au (finite difference) u t = au Von Neumann

C言語による数値計算プログラミング演習

, 1 ( f n (x))dx d dx ( f n (x)) 1 f n (x)dx d dx f n(x) lim f n (x) = [, 1] x f n (x) = n x x 1 f n (x) = x f n (x) = x 1 x n n f n(x) = [, 1] f n (x

数学の基礎訓練I

08 p Boltzmann I P ( ) principle of equal probability P ( ) g ( )g ( 0 ) (4 89) (4 88) eq II 0 g ( 0 ) 0 eq Taylor eq (4 90) g P ( ) g ( ) g ( 0

I

68 A mm 1/10 A. (a) (b) A.: (a) A.3 A.4 1 1

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý

cpall.dvi

基礎数学I

スライド 1

1F90/kouhou_hf90.dvi

y = x 4 y = x 8 3 y = x 4 y = x 3. 4 f(x) = x y = f(x) 4 x =,, 3, 4, 5 5 f(x) f() = f() = 3 f(3) = 3 4 f(4) = 4 *3 S S = f() + f() + f(3) + f(4) () *4

最小二乗フィット、カイ二乗フィット、gnuplot

広島工業大学紀要研究編第 44 巻 (2010)pp 論文 複素関数の積分に対する数値積分の試み 殿塚勲 * Application of Numerical method to Complex integration ( 平成 21 年 10 月 27 日受理 ) Isao TON


Microsoft PowerPoint - IntroAlgDs-05-5.ppt

Microsoft Word - FT_2010.doc

A B P (A B) = P (A)P (B) (3) A B A B P (B A) A B A B P (A B) = P (B A)P (A) (4) P (B A) = P (A B) P (A) (5) P (A B) P (B A) P (A B) A B P

Evoltion of onentration by Eler method (Dirihlet) Evoltion of onentration by Eler method (Nemann).2 t n =.4n.2 t n =.4n : t n

II (No.2) 2 4,.. (1) (cm) (2) (cm) , (

(Basic Theory of Information Processing) Fortran Fortan Fortan Fortan 1

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£²¡Ë

スライド 1

Microsoft PowerPoint - 講義10改.pptx

11042 計算機言語7回目 サポートページ:

1. ( ) 1.1 t + t [m]{ü(t + t)} + [c]{ u(t + t)} + [k]{u(t + t)} = {f(t + t)} (1) m ü f c u k u 1.2 Newmark β (1) (2) ( [m] + t ) 2 [c] + β( t)2

p-sylow :

OHP.dvi

時系列解析

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

GraphicsWithPlotFull.nb Plot[{( 1), ( ),...}, {( ), ( ), ( )}] Plot Plot Cos x Sin x, x, 5 Π, 5 Π, AxesLabel x, y x 1 Plot AxesLabel

カイ二乗フィット検定、パラメータの誤差

Microsoft Word - NumericalComputation.docx

1 α X (path) α I = [0, 1] X α(0) = α(1) = p α p (base point) loop α(1) = β(0) X α, β α β : I X (α β)(s) = ( )α β { α(2s) (0 s 1 2 ) β(2s 1) ( 1 2 s 1)

I

微分積分 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

OpenMP¤òÍѤ¤¤¿ÊÂÎó·×»»¡Ê£±¡Ë

C 2 2.1? 3x 2 + 2x + 5 = 0 (1) 1

2012 IA 8 I p.3, 2 p.19, 3 p.19, 4 p.22, 5 p.27, 6 p.27, 7 p

2 G(k) e ikx = (ik) n x n n! n=0 (k ) ( ) X n = ( i) n n k n G(k) k=0 F (k) ln G(k) = ln e ikx n κ n F (k) = F (k) (ik) n n= n! κ n κ n = ( i) n n k n

演習1: 演習準備

1 (1) () (3) I 0 3 I I d θ = L () dt θ L L θ I d θ = L = κθ (3) dt κ T I T = π κ (4) T I κ κ κ L l a θ L r δr δl L θ ϕ ϕ = rθ (5) l

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0)

応用数学特論.dvi


Hara-statistics

Microsoft Word - DF-Salford解説09.doc

untitled

QMII_10.dvi

スライド 1

b3e2003.dvi

SFGÇÃÉXÉyÉNÉgÉãå`.pdf

2 1 Octave Octave Window M m.m Octave Window 1.2 octave:1> a = 1 a = 1 octave:2> b = 1.23 b = octave:3> c = 3; ; % octave:4> x = pi x =

* n x 11,, x 1n N(µ 1, σ 2 ) x 21,, x 2n N(µ 2, σ 2 ) H 0 µ 1 = µ 2 (= µ ) H 1 µ 1 µ 2 H 0, H 1 *2 σ 2 σ 2 0, σ 2 1 *1 *2 H 0 H

°ÌÁê¿ô³ØII

: , 2.0, 3.0, 2.0, (%) ( 2.

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

I A A441 : April 21, 2014 Version : Kawahira, Tomoki TA (Kondo, Hirotaka ) Google

86 6 r (6) y y d y = y 3 (64) y r y r y r ϕ(x, y, y,, y r ) n dy = f(x, y) (6) 6 Lipschitz 6 dy = y x c R y(x) y(x) = c exp(x) x x = x y(x ) = y (init

TOP URL 1

1 1.1 ( ). z = a + bi, a, b R 0 a, b 0 a 2 + b 2 0 z = a + bi = ( ) a 2 + b 2 a a 2 + b + b 2 a 2 + b i 2 r = a 2 + b 2 θ cos θ = a a 2 + b 2, sin θ =

II - ( 02 ) 1,,,, 2, 3. ( ) HP,. 2 MATLAB MATLAB, C Java,,., MATLAB, Workspace, Workspace. Workspace who. whos. MATLAB, MATLAB Workspace. 2.1 Workspac

コンピュータ概論

/02/18

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

Fortran90/95 2. (p 74) f g h x y z f x h x = f x + g x h y = f y + g y h z = f z + g z f x f y f y f h = f + g Fortran 1 3 a b c c(1) = a(1) + b(1) c(

SOWC04....

Chap11.dvi

スライド 1

格子QCD実践入門

1 Tokyo Daily Rainfall (mm) Days (mm)


Collatzの問題 (数学/数理科学セレクト1)

I ( ) ( ) (1) C z = a ρ. f(z) dz = C = = (z a) n dz C n= p 2π (ρe iθ ) n ρie iθ dθ 0 n= p { 2πiA 1 n = 1 0 n 1 (2) C f(z) n.. n f(z)dz = 2πi Re

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² –

Microsoft PowerPoint - prog11.ppt

ÄêÀÑʬ¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ

¥Ñ¥Ã¥±¡¼¥¸ Rhpc ¤Î¾õ¶·

PowerPoint プレゼンテーション

Transcription:

δx δx n x=0 sin x = x x3 3 + x5 5 x7 7 +... x ak = (-mod(k,2))**(k/2) / fact_k ( ) = a n δ x n f x 0 + δ x a n = f ( n) ( x 0 ) n f ( x) = sin x n=0 58

I = b a ( ) f x dx ΔS = f ( x)h I = f a h h I = h ( ) + f ( a + h) +... + f ( a + ih) +... + f ( b h) N 1 i=1 ΔS = 1 2 I = 1 2 f a ( ) f a + ih f ( x) + f ( x + h) ( ) + 2 f ( a + h ) +... + 2 f ( a + ih ) +... + 2 f ( b h) + f ( b) h 59

積分法 I= N 1 1 f a + 2 f ( a + ih ) + f ( b ) h ( ) 2 i =1 である 台形法は2次の打ち切り誤差を持つ め足し合わせる y y=f(x) 似 積分 f(x) a f(x+h) h b x てを2次以上の多項式で近似 2.3 シンプソン法 h /2 近接するいくつかの区間を1まとめにして より高次の次数をもつ多項式で関数を近似 する方法である 精度は補間する関数の次数で決まる 例えば 区間[a,b]を偶数個nに 等分し 2つまとめにすると 3点を用いて2次多項式を当てはめることができる こ f (b ) h 2 f ( a + 2ih ) + のとき 小区間を2つ合わせた区間の面積は =1 ΔS = 1 f ( x ) + 4 f ( x + h ) + f ( x + 2h ) h 3 である このとき 区間[a,b]全体では 1 I = [ f ( a ) + 4 f ( a + h ) + 2 f ( a + 2h )... 3 + 2 f ( a + 2ih ) + 4 f ( a + {2i + 1} h ) +... + 2 f ( b 2h ) + 4 f ( b h ) + f ( b )]h となる 係数が 1 4 2 4 2 2 4 1となっている 2は小区間を2つ にまとめたΔS のつなぎ目である まとめると I= N /2 1 N /2 1 f a + 4 f a + 2i + 1 h + 2 f ( a + 2ih ) + f ( b ) h ( ) { } ( ) 3 i =1 i =1 となる 2次式で近似する方法は3次の打ち切り誤差を持つ 60

x 2/ π x= 2/ π x= f ( x) = e x2 = exp( x 2 ) erf x ( ) = 2 π 0 x ( ) exp ζ 2 dζ f (x) = ( )2 1 2πσ exp x µ 2 2σ 2 x 2 61

f95 taylor.f90 t_sine.f90 ****** Calculate sine by Talor-series expansion ****** program taylor implicit none integer i, n, ns real(8):: dx, xmax, pi real(8), allocatable:: x(:),s1(:),s2(:) real(8):: T_sine character(20):: fmt1 pi = 4.0d0 * atan(1.0d0) fmt1 = '(3f12.7)' write (6,*) 'Input number of samples for 1 period' read (5,*) ns write (6,*) 'Your input for number of samples = ',ns dx = 2.0d0 * pi / dfloat(ns) allocate ( x(0:ns),s1(0:ns),s2(0:ns) ) write (6,*) 'Input maximum order of Taylor series' 62

read (5,*) n write (6,*) 'Your input maximum order of Taylor series = ',n write (6,*) write (6,*) ' x sin(x) T_sine(x)' open (10,file='mysine.dat') do i = 0,ns x(i) = dx * dble(i) s1(i) = dsin(x(i)) s2(i) = T_sine(x(i),n) write ( 6,fmt1) x(i), s1(i), s2(i) write (10,fmt1) x(i), s1(i), s2(i) end do stop end program taylor ****** function T_sine ***************************************** function T_sine(x,n) implicit none integer:: k, n real(8):: pi real(8):: x, xp, fact_k, ak, fk real(8):: T_sine_k real(8):: T_sine real(8),parameter:: eps = 1.0d-10 63

pi = 4.0d0 * atan(1.0d0) initalize: f(x=0) = sin(0), 0 = 1, x**0 = 1.0 T_sine_k = 0.0d0 fact_k = 1.0d0 xp = 1.0d0 take summation sigma_( a(i)*x**i ) for i = 1 to n do k = 1,n fact_k = fact_k * dfloat(k) calculate factorial real(k) ak = (-mod(k,2))**(k/2) / fact_k coefficient of the series xp = xp * x fk = ak * xp calculate xp = x**k k-th order term T_sine_k = T_sine_k + fk calculate summation end do T_sine = T_sine_k return end function T_sine 64

real(8), allocatable:: x(:),s1(:),s2(:) allocate ( x(0:ns),s1(0:ns),s2(0:ns) ) real(8):: T_sine T_sine T_sine s2(i) = T_sine(x(i),n) T_sine write (10,500) x(i), s1(i), s2(i) real*8 function T_sine(x,n) T_sine = T_sine_k return 65

plot 'mysine.dat' using 1:2 plot 'mysine.dat' using 1:2, 'mysine.dat' using 1:3 plot 'mysine.dat' using 1:2 replot 'mysine.dat' using 1:3 replot 66

** Error function ** Numerical integration by trapezoid method program trapezoid_i implicit none integer, parameter:: n = 1000 integer:: i real(8):: f(0:n) real(8):: x,x1,x2,dx real(8):: s1,sall real(8):: erf real(8):: pi,rootpi write (6,*) 'x1 =' read (5,*) x1 x1 = 0.0d0 write (6,*) 'x =' read (5,*) x2 dx = ( x2-x1 ) / dfloat( n ) do i = 0,n x = x1 + dx * dfloat(i) f(i) = exp( - x**2 ) end do s1 = 0.0d0 do i = 1,n-1 s1 = s1 + 2.0d0*f(i) end do 67

sall = dx * 0.5d0 * ( f(0) + s1 + f(n) ) pi = 4.0d0 * atan( 1.0d0 ) rootpi = sqrt( pi ) erf = 2.0d0 / rootpi * sall write (6,*) 'Integral F = ',sall write (6,*) 'erf(',x2,')= ',erf stop end program trapezoid_i integer, parameter:: n = 1000n real(8):: f(0:n) f(i) = exp( - x**2 ) sall s1 = s1 + 2.0d0*f(i) s 1 = n 1 i=1 ( ) f x i s1 68