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

Size: px
Start display at page:

Download "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"

Transcription

1 C 1 / 21 C 2005 A * * * * *GnuPlot C * *Gnuplot *Gnuplot

2 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 int i, j; 9 10 / / 11 for( i = 0; i 9; i++ ){ 12 xx = ( float )i; 13 x[i] = xx; 14 y[i] = sqrt( xx ); 15 } xx = 4.4; 18 pn = 0; 19 for( i = 0; i 9; i++ ){ 20 p = y[i]; 21 for( j = 1; j 9; j++ ){ 22 if( i j ){ 23 p = p ( xx x[j] ) / ( x[i] x[j] ); 24 } 25 } 26 pn = pn + p; 27 } 28 printf( " %f %f\n", sqrt( xx ), pn ); 29 return 0; 2

3 C 3 / } : y = x : x = : %f %-20.15f x. 1.2 * newtonint.c 1 / / 2 #include <stdio.h> 3 #include <math.h> 4 #define N 9 5 int main() 6 { 7 float x[15], w[15]; 8 float xx, kotae; 9 int i, j; / / 12 for( i = 1; i N; i++ ){ 13 xx = ( float )i; 14 x[i] = xx; 15 w[i] = sqrt( xx ); 16 } for( i = 1; i N; i++ ){ 19 for( j = N; j > i; j ){ 20 w[j] = ( w[j] w[j 1] ) / ( x[j] x[j i] ); 21 } 22 } 23 3

4 C 4 / xx = 4.4; 25 kotae = w[n]; 26 for( i = N 1; i 1; i ){ 27 kotae = kotae ( xx x[i] ) + w[i]; 28 } 29 printf( " %f %f\n", kotae, sqrt( xx )); 30 return 0; 31 } : y = x : x = : x x 3 dx chuteni.c 1 / / 2 #include <stdio.h> 3 #include <math.h> 4 #define N float f( float x ) 7 { 8 return x x x; 9 } int main() 12 { 13 float x, y, sum, f0 = 0., fn = 1., step; sum = 0.; 16 step = ( fn f0 ) / (2 N); 4

5 C 5 / for( x = f0 + step; x < fn; x = x + 2 step ) sum = sum + f( x ); 18 printf( "%f\n", 2 step sum ); 19 return 0; 20 } 4 : N : f(x) = x 3 13 : f0 fn 16 : step 2N : x 3 dx daikei.c 1 / / 2 #include <stdio.h> 3 #include <math.h> 4 #define N float f( float x ) 7 { 8 return x x x; 9 } int main() 12 { 13 float x, y, sum, f0 = 0., fn = 1., step; sum = 0.; 16 step = ( fn f0 ) / N; 17 for( x = f0 + step; x < fn; x = x + step ) sum = sum + f( x ); 18 printf( "%f\n", step / 2. ( f( f0 ) + f( fn ) + 2. sum )); 19 return 0; 5

6 C 6 / } 4 : N : f(x) = x 3 13 : f0 fn 16 : step N : x 3 dx symp.c 1 / / 2 #include <stdio.h> 3 #include <math.h> 4 #define N float f( float x ) 7 { 8 return x x x; 9 } int main() 12 { 13 float x, y, sum, f0 = 0., fn = 1., step; 14 int i; sum = f( f0 ) + f( fn ); 17 step = ( fn f0 ) / N; 18 i = 1; 19 for( x = f0 + step; x < fn; x = x + step ){ 20 if( i % 2 == 0 ){ 21 sum = sum + 2. f( x ); 22 }else{ 6

7 C 7 / sum = sum + 4. f( x ); 24 } 25 i++; 26 } 27 printf( "%f\n", step / 3. sum ); 28 return 0; 29 } 4 : N : f(x) = x 3 13 : f0 fn 17 : step N : 2.4 * dx π 1 + x2 numint.c 1 / / 2 #include <stdio.h> 3 #include <stdlib.h> 4 5 double f(double x) 6 { 7 return 4 / (1 + x x); 8 } 9 10 int main() 11 { 12 int i, n, nmax = 32; 13 double a = 0, b = 1, h, trapezoid, midpoint, simpson; printf(" n: Simpson\n"); 7

8 C 8 / h = b a; trapezoid = h (f(a) + f(b)) / 2; 17 for (n = 1; n nmax; n = 2) { 18 midpoint = 0; 19 for (i = 1; i n; i++) midpoint += f(a + h (i 0.5)); 20 midpoint = h; 21 simpson = (trapezoid + 2 midpoint) / 3; 22 printf("%5d % f % f % f \n", 23 n, trapezoid, midpoint, simpson); 24 h / 2; trapezoid = (trapezoid + midpoint) / 2; 25 } 26 return EXIT SUCCESS; 27 } 5 8 : f(x) = 4 1+x 2 12 : nmax=32 13 : a b 16 : h : h h 2 h 4, h 8, h 16, h nmax= equation1.c 1 #include <stdio.h> 2 #include <math.h> 3 4 main() 5 { 8

9 C 9 / 21 6 double a, b, c, d; 7 double x1, x2; 8 a=1;b=2;c=1; 9 d = b b 4.0 a c; 10 if (d 0.0) { 11 x1 = ( b+sqrt(d))/(2.0 a); 12 x2 = ( b sqrt(d))/(2.0 a); 13 printf("x1=%-27.20f (%-27.20f)\n", x1, a x1 x1+b x1+c); 14 printf("x2=%-27.20f (%-27.20f)\n", x2, a x2 x2+b x2+c); 15 } 16 else { 17 printf("x1=n.a.\n"); 18 printf("x2=n.a.\n"); 19 } 20 exit(0); 21 } 6 : a,b,c 9 : d : 13 : x 1 ax bx 1 + c 0 14 : 13 x : N.A. a, b, c equation2.c 1 #include <stdio.h> 2 #include <math.h> 3 4 main() 5 { 6 double a, b, c, d; 9

10 C 10 / 21 7 double x1, x2; 8 9 a=1;b=2;c=1; 10 d = b b 4.0 a c; 11 if (d 0.0) { 12 x1 = (fabs(b)+sqrt(d))/(2.0 a); 13 x1 = (b<0.0)?x1: x1; 14 x2 = c/(a x1);/ / 15 printf("x1=%-27.20f (%-27.20f)\n", x1, a x1 x1+b x1+c); 16 printf("x2=%-27.20f (%-27.20f)\n", x2, a x2 x2+b x2+c); 17 } 18 else { 19 printf("x1=n.a.\n"); 20 printf("x2=n.a.\n"); 21 } 22 exit(0); 23 } equation1.c : x 1 = b + d,b 0 x 1 2a x 1 14 : x 2 a, b, c bisect.c 1 / / 2 #include <stdio.h> 3 #include <math.h> 4 #define e #define kukana 1. 6 #define kukanb 2. 10

11 C 11 / float f( float x ) 10 { 11 return x x 2.; 12 } int main() 15 { 16 float xa, xb,xc,y; 17 int i; 18 xa = kukana; 19 xb = kukanb; 20 for( i = 1; i 50; i++ ){ 21 xc = ( xa + xb ) / 2.; 22 y=f(xc); 23 printf( "%d, %f\n", i,xc ); 24 if( fabs( y ) < e ){ 25 return 0; 26 } 27 if( f( xa ) f( xc ) < 0 ){ 28 xb = xc; 29 }else{ 30 xa = xc; 31 } 32 } 33 printf( "\n" ); 34 return 0; 35 } 4 6 : e= ,kukana=1,kukanb=2 kukana kukanb : f(x) = x : xa,xb : 2 11

12 C 12 / : y = f(xc) e 33 : 50 y = f(xc) e * 2 x 2 2 regula.c 1 / / 2 #include <stdio.h> 3 #include <math.h> 4 #define e #define kukana 1. 6 #define kukanb float f( float x ) 9 { 10 return( x x 2. ); 11 } int main() 14 { 15 float xa, xb, xc, y; 16 int i; xa = kukana; 19 xb = kukanb; 20 for( i = 1; i 50; i++ ){ 21 xc = ( xa f( xb ) xb f( xa )) / ( f( xb ) f( xa )); 22 y = f( xc ); 23 printf( " %d, %f\n", i,xc ); 24 if( fabs( y ) < e ){ 25 return 0; 12

13 C 13 / } 27 if( f( xa ) f( xc ) < 0 ){ 28 xb = xc; 29 }else{ 30 xa = xc; 31 } 32 } 33 printf( "\n" ); 34 return 0; 35 } 2 21 (xa, f(xa)), (xb, f(xb)) x Newton x newton.c 1 / / 2 / 0 / 3 #include <stdio.h> 4 #include <math.h> 5 #define e #define initial float f( float x ) 9 { 10 return x x 2; 11 } 12 float diff( float x ) 13

14 C 14 / { 14 return 2. x; 15 } 16 int main() 17 { 18 float xa, xb; 19 int i; xa = initial; 22 for( i = 1; i 50; i++ ){ 23 xb = xa f(xa) /diff(xa); 24 printf( "%d, %f\n", i, xb ); 25 if( fabs( f(xb)) < e ){ 26 return 0; 27 } 28 xa = xb; 29 } 30 printf( " \n" ); 31 return 0; 32 } 6 : initial = 2 x 8 10 : f(x) = x : f (x) 21 : xa = initial 23 : xb = xa f(xa) f (xa) 28 : xa x xb *GnuPlot GnuPlot GnuPlot data newtong.c 1 / / 2 / 0 / 3 / gnuplot / 14

15 C 15 / 21 4 #include <stdio.h> 5 #include <math.h> 6 #define e #define initial float f( float x ) 10 { 11 return x x 2; 12 } 13 float diff( float x ) 14 { 15 return 2. x; 16 } int main() 20 { 21 float xa, xb; 22 int i; xa = initial; 25 for( i = 1; i 50; i++ ){ 26 printf( "%f %f\n",xa,f(xa)); 27 xb = xa f(xa) /diff(xa); 28 printf( "%f 0.0\n", xb); 29 printf("\n"); 30 if( fabs( f(xb)) < e ){ 31 return 0; 32 } 33 xa = xb; 34 } 35 return 0; 36 } 15

16 C 16 / 21 4 f(x) α (f(α) = α) α = e α α 4.1 iteration.c 1 / / 2 #include <stdio.h> 3 #include <math.h> 4 #define begin 0.5 / / 5 #define eps / / 6 7 float f( float x ) 8 { 9 return exp( x); 10 } int main() 13 { 14 float xa, xb; 15 int i; xa = begin; 18 for( i = 1; i 50; i++ ) 19 { 20 xb = f(xa); 21 printf( "%f\n", xb ); 22 if( fabs(xa xb) < eps ) 23 { 24 printf( "%f\n",xb ); 25 return 0; 26 } 27 xa = xb; 16

17 C 17 / } 29 printf( " \n" ); 30 return 0; 31 } 4 : begin = 0.5 x 7 10 : f(x) = e x 17 : xa = begin x : xb = f(xa) xa xb < eps 29 : 50 xa xb eps 4.2 *GnuPlot iterationg.c 1 / / 2 / gnuplot / 3 #include <stdio.h> 4 #include <math.h> 5 #define begin 1.0 / / 6 #define eps / / 7 8 float f( float x ) 9 { 10 return exp( x); 11 } int main() 14 { 15 float xa, xb; 16 int i; xa = begin; 19 for( i = 1; i 50; i++ ) 20 { 21 xb = f(xa); 22 printf( "%f, %f\n", xa,xa ); 17

18 C 18 / printf( "%f, %f\n", xa,xb ); 24 if( fabs(xa xb) < eps ) 25 { 26 return 0; 27 } 28 xa = xb; 29 } 30 return 0; 31 } C Unix > C sample.c > gcc -lm sample.c >./a.out mule 5.2 * >./a.out > test.dat test.dat 5.3 *Gnuplot gnuplot gnuplot > gnuplot test.dat gnuplot > plot test.dat with lines test.dat gnuplot > plot test.dat with dots test.dat 18

19 C 19 / 21 gnuplot view.gp gnuplot > load view.gp view.gp gnuplot 5.4 *Gnuplot newtong.c > gcc -lm newtong.c >./a.out > newton.dat newton.dat gnuplot > plot x*x -2 y = x 2 2 gnuplot > replot 0 y = 0 x gnuplot > replot newton.dat with lines y = x iterationg.c > gcc -lm iterationg.c >./a.out > iteration.dat 19

20 C 20 / 21 iteration.dat gnuplot > plot exp(-x) y = e x gnuplot > replot x y = x gnuplot > replot iteration.dat with lines 20

21 C 21 / f(x) = x [0, 10] x = 0, 1, 2,, 10 2 x = 9 : lagrange.c 6.2 f(x) = e x2 2 f(x)dx 8 8 f(x)dx 2π C 2π sqrt(8*atan(1)) exp( x 2 ) C exp(-x*x/2) : daikei.c 6.3 f(x) = x 3 1 f(x) = x = 0.1 : bisect.c,newton.c 6.4 m = x E sin x f(x) = m + E sin x x = f(x) m = 0.8, E = 0.2 : [0, 1] sin x C sin(x) : iteration.c 21

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

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 Simpson H4 BioS. Simpson 3 3 0 x. β α (β α)3 (x α)(x β)dx = () * * x * * ɛ δ 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()

More information

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

joho09.ppt

joho09.ppt s M B e E s: (+ or -) M: B: (=2) e: E: ax 2 + bx + c = 0 y = ax 2 + bx + c x a, b y +/- [a, b] a, b y (a+b) / 2 1-2 1-3 x 1 A a, b y 1. 2. a, b 3. for Loop (b-a)/ 4. y=a*x*x + b*x + c 5. y==0.0 y (y2)

More information

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 1 刷発行時のものです.

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.  このサンプルページの内容は, 新装版 1 刷発行時のものです. C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009383 このサンプルページの内容は, 新装版 1 刷発行時のものです. i 2 22 2 13 ( ) 2 (1) ANSI (2) 2 (3) Web http://www.morikita.co.jp/books/mid/009383

More information

kiso2-09.key

kiso2-09.key 座席指定はありません 計算機基礎実習II 2018 のウェブページか 第9回 ら 以下の課題に自力で取り組んで下さい 計算機基礎実習II 第7回の復習課題(rev07) 第9回の基本課題(base09) 第8回試験の結果 中間試験に関するコメント コンパイルできない不完全なプログラムなど プログラミングに慣れていない あるいは複雑な問題は 要件 をバラして段階的にプログラムを作成する exam08-2.c

More information

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i )

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i ) 1 f(x) a b f(x)dx = n A(x i ) (1) ix [a, b] n i A(x i ) x i 1 f(x) [a, b] n h = (b a)/n y h = (b-a)/n y = f (x) h h a a+h a+2h a+(n-1)h b x 1: 1 x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x

More information

kiso2-06.key

kiso2-06.key 座席指定があります Linux を起動して下さい 第6回 計算機基礎実習II 計算機基礎実習II 2018 のウェブページか ら 以下の課題に自力で取り組んで下さい 第5回の復習課題(rev05) 第6回の基本課題(base06) 第5回課題の回答例 ex05-2.c 1. キーボードから整数値 a を入力すると a*a*a の値を出力することを繰り返すプログラムを作成しなさい 2. ただし 入力された

More information

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)

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) E-mail: takio-kurita@aist.go.jp 1 ( ) CPU ( ) 2 1. a f(a) =(a 1.0) 2 (1) a ( ) 1(a) f(a) a (1) a f(a) a =2(a 1.0) (2) 2 0 a f(a) a =2(a 1.0) = 0 (3) 1 9 8 7 (x-1.0)*(x-1.0) 6 4 2.0*(x-1.0) 6 2 5 4 0 3-2

More information

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231 0 0.1 ANSI-C 0.2 web http://www1.doshisha.ac.jp/ kibuki/programming/resume p.html 0.3 2012 1 9/28 0 [ 01] 2 10/5 1 C 2 3 10/12 10 1 2 [ 02] 4 10/19 3 5 10/26 3 [ 03] 6 11/2 3 [ 04] 7 11/9 8 11/16 4 9 11/30

More information

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

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² – (2018) 11 2018 12 13 2 g v dv x dt = bv x, dv y dt = g bv y (1) b v 0 θ x(t) = v 0 cos θ ( 1 e bt) (2) b y(t) = 1 ( v 0 sin θ + g ) ( 1 e bt) g b b b t (3) 11 ( ) p14 2 1 y 4 t m y > 0 y < 0 t m1 h = 0001

More information

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±

[1] #include<stdio.h> main() { printf(hello, world.); return 0; } (G1) int long int float ± ± [1] #include printf("hello, world."); (G1) int -32768 32767 long int -2147483648 2147483647 float ±3.4 10 38 ±3.4 10 38 double ±1.7 10 308 ±1.7 10 308 char [2] #include int a, b, c, d,

More information

2017 p vs. TDGL 4 Metropolis Monte Carlo equation of continuity s( r, t) t + J( r, t) = 0 (79) J s flux (67) J (79) J( r, t) = k δf δs s( r,

2017 p vs. TDGL 4 Metropolis Monte Carlo equation of continuity s( r, t) t + J( r, t) = 0 (79) J s flux (67) J (79) J( r, t) = k δf δs s( r, 27 p. 47 7 7. vs. TDGL 4 Metropolis Monte Carlo equation of continuity s( r, t) t + J( r, t) = (79) J s flux (67) J (79) J( r, t) = k δf δs s( r, t) t = k δf δs (59) TDGL (8) (8) k s t = [ T s s 3 + ξ

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó  ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡ (2018) 2018 5 17 0 0 if switch if if ( ) if ( 0) if ( ) if ( 0) if ( ) (0) if ( 0) if ( ) (0) ( ) ; if else if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 (0) 2 if else

More information

sim98-8.dvi

sim98-8.dvi 8 12 12.1 12.2 @u @t = @2 u (1) @x 2 u(x; 0) = (x) u(0;t)=u(1;t)=0fort 0 1x, 1t N1x =1 x j = j1x, t n = n1t u(x j ;t n ) Uj n U n+1 j 1t 0 U n j =1t=(1x) 2 = U n j+1 0 2U n j + U n j01 (1x) 2 (2) U n+1

More information

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

C 2 2.1? 3x 2 + 2x + 5 = 0 (1) 1 2006 7 18 1 2 C 2 2.1? 3x 2 + 2x + 5 = 0 (1) 1 2 7x + 4 = 0 (2) 1 1 x + x + 5 = 0 2 sin x x = 0 e x + x = 0 x = cos x (3) x + 5 + log x? 0.1% () 2.2 p12 3 x 3 3x 2 + 9x 8 = 0 (4) 1 [ ] 1/3 [ 2 1 ( x 1

More information

comment.dvi

comment.dvi ( ) (sample1.c) (sample1.c) 2 2 Nearest Neighbor 1 (2D-class1.dat) 2 (2D-class2.dat) (2D-test.dat) 3 Nearest Neighbor Nearest Neighbor ( 1) 2 1: NN 1 (sample1.c) /* -----------------------------------------------------------------

More information

2 P.S.P.T. P.S.P.T. wiki 26

2 P.S.P.T. P.S.P.T. wiki  26 P.S.P.T. C 2011 4 10 2 P.S.P.T. P.S.P.T. wiki p.s.p.t.since1982@gmail.com http://www23.atwiki.jp/pspt 26 3 2 1 C 8 1.1 C................................................ 8 1.1.1...........................................

More information

スライド 1

スライド 1 数値解析 平成 24 年度前期第 7 週 [2012 年 5 月 30 日 ] 静岡大学創造科学技術大学院情報科学専攻工学部機械工学科計測情報講座 三浦憲二郎 講義アウトライン [5 月 30 日 ] 数値積分 ニュートン コーツ公式 台形公式 シンプソン公式 多積分 数値積分の必要性 p.135 初等関数 ( しょとうかんすう ) とは 複素数を変数とする多項式関数 指数関数 対数関数主値の四則演算

More information

1 28 6 12 7 1 7.1...................................... 2 7.1.1............................... 2 7.1.2........................... 2 7.2...................................... 3 7.3...................................

More information

θ (t) ω cos θ(t) = ( : θ, θ. ( ) ( ) ( 5) l () θ (t) = ω sin θ(t). ω := g l.. () θ (t) θ (t)θ (t) + ω θ (t) sin θ(t) =. [ ] d dt θ (t) ω cos θ(t

θ (t) ω cos θ(t) = ( : θ, θ. ( ) ( ) ( 5) l () θ (t) = ω sin θ(t). ω := g l.. () θ (t) θ (t)θ (t) + ω θ (t) sin θ(t) =. [ ] d dt θ (t) ω cos θ(t 7 8, /3/, 5// http://nalab.mind.meiji.ac.jp/~mk/labo/text/furiko/ l (, simple pendulum) m g mlθ (t) = mg sin θ(t) () θ (t) + ω sin θ(t) =, ω := ( m ) ( θ ) sin θ θ θ (t) + ω θ(t) = ( ) ( ) g l θ(t) = C

More information

#define N1 N+1 double x[n1] =.5, 1., 2.; double hokan[n1] = 1.65, 2.72, 7.39 ; double xx[]=.2,.4,.6,.8,1.2,1.4,1.6,1.8; double lagrng(double xx); main

#define N1 N+1 double x[n1] =.5, 1., 2.; double hokan[n1] = 1.65, 2.72, 7.39 ; double xx[]=.2,.4,.6,.8,1.2,1.4,1.6,1.8; double lagrng(double xx); main =1= (.5, 1.65), (1., 2.72), (2., 7.39).2,.4,.6,.8, 1., 1.2, 1.4, 1.6 1 1: x.2 1.4128.4 1.5372.6 1.796533.8 2.198 1.2 3.384133 1.4 4.1832 1.6 5.1172 8 7 6 5 y 4 3 2 1.5 1 1.5 2 x 1: /* */ #include

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

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

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó  ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý (2018) 2018 7 5 f(x) [ 1, 1] 3 3 1 3 f(x) dx c i f(x i ) 1 0 i=1 = 5 ) ( ) 3 ( 9 f + 8 5 9 f(0) + 5 3 9 f 5 1 1 + sin(x) θ ( 1 θ dx = tan 1 + sin x 2 π ) + 1 4 1 3 [a, b] f a, b double G3(double (*f)(),

More information

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç C (3) if else switch AND && OR (NOT)! 1 BMI BMI BMI = 10 4 [kg]) ( [cm]) 2 bmi1.c Input your height[cm]: 173.2 Enter Input your weight[kg]: 60.3 Enter Your BMI is 20.1. 10 4 = 10000.0 1 BMI BMI BMI = 10

More information

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return 0; 戻り値 1: main() 2.2 C main

1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf(hello World!!\n); return 0; 戻り値 1: main() 2.2 C main C 2007 5 29 C 1 11 2 2.1 main() 1 FORTRAN C main() main main() main() 1 return 1 1 return main() { main main C 1 戻り値の型 関数名 引数 関数ブロックをあらわす中括弧 main() 関数の定義 int main(void){ printf("hello World!!\n"); return

More information

資料

資料 PC PC C VMwareをインストールする Tips: VmwareFusion *.vmx vhv.enable = TRUE Tips: Windows Hyper-V -rwxr-xr-x 1 masakazu staff 8552 7 29 13:18 a.out* -rw------- 1 masakazu staff 8552 7 29

More information

2004 2005 2 2 1G01P038-0 1 2 1.1.............................. 2 1.2......................... 2 1.3......................... 3 2 4 2.1............................ 4 2.2....................... 4 2.3.......................

More information

Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include <stdio.h> main(){ printf("hel

Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include <stdio.h> main(){ printf(hel Numerical Rosetta Stone 1 C, Java, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include main(){ printf("hello world of C!\n"); Java: // hello.java $> javac hello.java

More information

P02.ppt

P02.ppt int If 2 1 ,,, 3 a + b ab a - b ab a * b ab a / b ab a % b ab a + b 4 2 list0201.c /, % /*/ int vx, vy; puts(""); printf("vx"); scanf("%d", &vx); printf("vy"); scanf("%d", &vy); printf("vx + vy = %d\n",

More information

関数のグラフを描こう

関数のグラフを描こう L05(2010-05-07) 1 2 hig3.net ( ) L05(2010-05-07) 1 / 16 #i n c l u d e double f ( double x ) ; i n t main ( void ){ i n t n ; i n t nmax=10; double x ; double s =0.0; } x = 1.0; s=s+x ;

More information

1 5 13 4 1 41 1 411 1 412 2 413 3 414 3 415 4 42 6 43 LU 7 431 LU 10 432 11 433 LU 11 44 12 441 13 442 13 443 SOR ( ) 14 444 14 445 15 446 16 447 SOR 16 448 16 45 17 4 41 n x 1,, x n a 11 x 1 + a 1n x

More information

1 4 2 EP) (EP) (EP)

1 4 2 EP) (EP) (EP) 2003 2004 2 27 1 1 4 2 EP) 5 3 6 3.1.............................. 6 3.2.............................. 6 3.3 (EP)............... 7 4 8 4.1 (EP).................... 8 4.1.1.................... 18 5 (EP)

More information

(, ) (, ) S = 2 = [, ] ( ) 2 ( ) 2 2 ( ) 3 2 ( ) 4 2 ( ) k 2,,, k =, 2, 3, 4 S 4 S 4 = ( ) 2 + ( ) ( ) (

(, ) (, ) S = 2 = [, ] ( ) 2 ( ) 2 2 ( ) 3 2 ( ) 4 2 ( ) k 2,,, k =, 2, 3, 4 S 4 S 4 = ( ) 2 + ( ) ( ) ( B 4 4 4 52 4/ 9/ 3/3 6 9.. y = x 2 x x = (, ) (, ) S = 2 = 2 4 4 [, ] 4 4 4 ( ) 2 ( ) 2 2 ( ) 3 2 ( ) 4 2 ( ) k 2,,, 4 4 4 4 4 k =, 2, 3, 4 S 4 S 4 = ( ) 2 + ( ) 2 2 + ( ) 3 2 + ( 4 4 4 4 4 4 4 4 4 ( (

More information

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

Microsoft Word - 03-数値計算の基礎.docx δx f x 0 + δ x n=0 a n = f ( n) ( x 0 ) n δx n f x x=0 sin x = x x3 3 + x5 5 x7 7 +... x ( ) = a n δ x n ( ) = sin x ak = (-mod(k,2))**(k/2) / fact_k 10 11 I = f x dx a ΔS = f ( x)h I = f a h I = h b (

More information

新・明解C言語 ポインタ完全攻略

新・明解C言語 ポインタ完全攻略 2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)

More information

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf("hello World\n"); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf(hello World\n); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o 18 C ( ) 1 1 1.1 hello world.c 5 printf("hello World\n"); 6 } [ ] [ ] #include % cc hello_world.c %./a.out Hello World [a.out ] % cc hello_world.c -o hello_world [ ( ) ] (K&R 4.1.1) #include

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

Microsoft Word - C.....u.K...doc

Microsoft Word - C.....u.K...doc C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ

More information

x () g(x) = f(t) dt f(x), F (x) 3x () g(x) g (x) f(x), F (x) (3) h(x) = x 3x tf(t) dt.9 = {(x, y) ; x, y, x + y } f(x, y) = xy( x y). h (x) f(x), F (x

x () g(x) = f(t) dt f(x), F (x) 3x () g(x) g (x) f(x), F (x) (3) h(x) = x 3x tf(t) dt.9 = {(x, y) ; x, y, x + y } f(x, y) = xy( x y). h (x) f(x), F (x [ ] IC. f(x) = e x () f(x) f (x) () lim f(x) lim f(x) x + x (3) lim f(x) lim f(x) x + x (4) y = f(x) ( ) ( s46). < a < () a () lim a log xdx a log xdx ( ) n (3) lim log k log n n n k=.3 z = log(x + y ),

More information

‚æ4›ñ

‚æ4›ñ ( ) ( ) ( ) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 (OUS) 9 26 1 / 28 ( ) ( ) ( ) A B C D Z a b c d z 0 1 2 9 (OUS) 9

More information

実際の株価データを用いたオプション料の計算

実際の株価データを用いたオプション料の計算 2002 2 20 1 1 3 2 3 2.1 : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5 2.1.1 : : : : : : : : : : : : : : : : : : : : 5 2.1.2 : : : : : : : : : : : : : : : : : : : : 6 2.2 : : : : : : : : : :

More information

O(N) ( ) log 2 N

O(N) ( ) log 2 N 2005 11 21 1 1.1 2 O(N) () log 2 N 1.2 2 1 List 3-1 List 3-3 List 3-4? 3 3.1 3.1.1 List 2-1(p.70) 1 1 10 1 3.1.2 List 3-1(p.70-71) 1 1 2 1 2 2 1: 1 3 3.1.3 1 List 3-1(p.70-71) 2 #include stdlib.h

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2017 2017 08 03 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF X [ S ] a S S ; X X X, S [, a, ], ; BNF X (parse tree) (1) [a;a] (2) [[a]] (3) [a;[a]] (4) [[a];a] : [a] X 2 222222

More information

P06.ppt

P06.ppt p.130 p.198 p.208 2 1 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i < NUM; i++ ) if ( weight[i] > max ) max = weight[i]: if ( weight[i] < min ) min = weight[i]: weight 3 maxof(a,

More information

( )/2 hara/lectures/lectures-j.html 2, {H} {T } S = {H, T } {(H, H), (H, T )} {(H, T ), (T, T )} {(H, H), (T, T )} {1

( )/2   hara/lectures/lectures-j.html 2, {H} {T } S = {H, T } {(H, H), (H, T )} {(H, T ), (T, T )} {(H, H), (T, T )} {1 ( )/2 http://www2.math.kyushu-u.ac.jp/ hara/lectures/lectures-j.html 1 2011 ( )/2 2 2011 4 1 2 1.1 1 2 1 2 3 4 5 1.1.1 sample space S S = {H, T } H T T H S = {(H, H), (H, T ), (T, H), (T, T )} (T, H) S

More information

ex14.dvi

ex14.dvi 1,, 0, b (b b 2 b ) n k n = n j b j, (0 n j b 1), n =(n k n k 1...n 1 n 0 ) b, n j j j +1, 0,...,b 1 (digit). b b, n b 1 ñ, ñ = k (b 1 n j )b j b N, n b n, n = b N n, n =ñ+1 b N, n m n + m (mod b N ),

More information

P05.ppt

P05.ppt 2 1 list0415.c forfor #include int i, j; for (i = 1; i

More information

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

Taro-数値計算の基礎Ⅱ(公開版)

Taro-数値計算の基礎Ⅱ(公開版) 0. 目次 1. 2 分法 2. はさみうち法 3. 割線法 4. 割線法 ( 2 次曲線近似 ) 5. ニュートン法 ( 接線近似 ) - 1 - 1. 2 分法 区間 [x0,x1] にある関数 f(x) の根を求める 区間 [x0,x1] を xm=(x0+x1)/2 で 2 等分し 区間 [x0,xm],[xm,x1] に分割する f(xm) の絶対値が十分小さい値 eps より小さいとき

More information

lecture

lecture 5 3 3. 9. 4. x, x. 4, f(x, ) :=x x + =4,x,.. 4 (, 3) (, 5) (3, 5), (4, 9) 95 9 (g) 4 6 8 (cm).9 3.8 6. 8. 9.9 Phsics 85 8 75 7 65 7 75 8 85 9 95 Mathematics = ax + b 6 3 (, 3) 3 ( a + b). f(a, b) ={3 (a

More information

A 30 A A ( ) 2 C C (, machine language) C (C compiler) ( ) Mac Apple Xcode Clan

A 30 A A ( ) 2 C C (, machine language) C (C compiler) ( ) Mac Apple Xcode Clan C 2017 9 29, 30 5 13 http://nalab.mind.meiji.ac.jp/~mk/labo/text/ 1 2 2 C 2 3 4 3.1 C................................... 4 3.2 Hello world........................................ 5 3.3 5...............................

More information

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

More information

c-all.dvi

c-all.dvi III(994) (994) from PSL (9947) & (9922) c (99,992,994,996) () () 2 3 4 (2) 2 Euler 22 23 Euler 24 (3) 3 32 33 34 35 Poisson (4) 4 (5) 5 52 ( ) 2 Turbo 2 d 2 y=dx 2 = y y = a sin x + b cos x x = y = Fortran

More information

PowerPoint Presentation

PowerPoint Presentation p.130 p.198 p.208 2 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i i < NUM; i++ ) ) if if ( weight[i] > max ) max = weight[i]: if if ( weight[i] < min ) min = weight[i]: weight

More information

C , C++ C C++ C++ C cpprefjp - C++ 1 C CUI 2.1 donothing.cpp 1

C , C++ C C++ C++ C cpprefjp - C++ 1 C CUI 2.1 donothing.cpp 1 C++ 2018 7 1, 2018 11 4 http://nalab.mind.meiji.ac.jp/~mk/labo/text/nantoka-c++/ 1 C++ C C++ C++ C cpprefjp - C++ 1 C++17 2 2 CUI 2.1 donothing.cpp 1 /* 2 * donothing.cpp 3 */ 4 5 int main() 6 7 return

More information

Ver.2.2 20.07.2 3 200 6 2 4 ) 2) 3) 4) 5) (S45 9 ) ( 4) III 6) 7) 8) 9) ) 2) 3) 4) BASIC 5) 6) 7) 8) 9) ..2 3.2. 3.2.2 4.2.3 5.2.4 6.3 8.3. 8.3.2 8.3.3 9.4 2.5 3.6 5 2.6. 5.6.2 6.6.3 9.6.4 20.6.5 2.6.6

More information

num2.dvi

num2.dvi kanenko@mbk.nifty.com http://kanenko.a.la9.jp/ 16 32...... h 0 h = ε () 0 ( ) 0 1 IEEE754 (ieee754.c Kerosoft Ltd.!) 1 2 : OS! : WindowsXP ( ) : X Window xcalc.. (,.) C double 10,??? 3 :, ( ) : BASIC,

More information

1 1 [1] ( 2,625 [2] ( 2, ( ) /

1 1 [1] ( 2,625 [2] ( 2, ( ) / [] (,65 [] (,3 ( ) 67 84 76 7 8 6 7 65 68 7 75 73 68 7 73 7 7 59 67 68 65 75 56 6 58 /=45 /=45 6 65 63 3 4 3/=36 4/=8 66 7 68 7 7/=38 /=5 7 75 73 8 9 8/=364 9/=864 76 8 78 /=45 /=99 8 85 83 /=9 /= ( )

More information

all.dvi

all.dvi fortran 1996 4 18 2007 6 11 2012 11 12 1 3 1.1..................................... 3 1.2.............................. 3 2 fortran I 5 2.1 write................................ 5 2.2.................................

More information

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* ( 2016 2016 07 28 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF : 11011 N N 0 N N 11 1001 N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) 1100100 (2) 1111011 (3) 1110010 (4) 1001011

More information

1 1 sin cos P (primary) S (secondly) 2 P S A sin(ω2πt + α) A ω 1 ω α V T m T m 1 100Hz m 2 36km 500Hz. 36km 1

1 1 sin cos P (primary) S (secondly) 2 P S A sin(ω2πt + α) A ω 1 ω α V T m T m 1 100Hz m 2 36km 500Hz. 36km 1 sin cos P (primary) S (secondly) 2 P S A sin(ω2πt + α) A ω ω α 3 3 2 2V 3 33+.6T m T 5 34m Hz. 34 3.4m 2 36km 5Hz. 36km m 34 m 5 34 + m 5 33 5 =.66m 34m 34 x =.66 55Hz, 35 5 =.7 485.7Hz 2 V 5Hz.5V.5V V

More information

Microsoft Word - Cプログラミング演習(3)

Microsoft Word - Cプログラミング演習(3) 第 3 回 (5/7) 5. ループ ( 繰り返し ) 1 for 文 例題 1-15 正の数 n をキーボードから入力すると,1 から n までの整数の和を出力するプログラムをつくりなさい 出力結果 1-15 2 以上の整数を入力してください! 357 1 + + 357 = 63903 考え方合計を保持する変数を long 型で宣言し, 入力した数値 n までループ処理で累積する 正しい数値が入力されたとき

More information

[ ] π = C: /* pi.c $> gcc pi.c -lm $>./a.out */ #include <stdio.h> #include <math.h> main(){ double pi=4*atan(1); printf("%lf\n", pi); # pi=m

[ ] π = C: /* pi.c $> gcc pi.c -lm $>./a.out */ #include <stdio.h> #include <math.h> main(){ double pi=4*atan(1); printf(%lf\n, pi); # pi=m Numerical Rosetta Stone 1 C, Java, Fortran, Perl, Ruby, Python [ ] Hello world C: /* hello.c $> gcc hello.c $>./a.out */ #include main(){ printf("hello world of C!\n"); Java: // hello.java $>

More information

新版明解C言語 実践編

新版明解C言語 実践編 2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,

More information

- II

- II - II- - -.................................................................................................... 3.3.............................................. 4 6...........................................

More information

講習No.12

講習No.12 前回までの関数のまとめ 関数は main() 関数または他の関数から呼び出されて実行される. 関数を呼び出す側の実引数の値が関数内の仮引数 ( 変数 ) にコピーされる. 関数内で定義した変数は, 関数の外からは用いることができない ( ローカル変数 ). 一般に関数内で仮引数を変化しても, 呼び出し側の変数は変化しない ( 値渡し ). 関数内で求めた値は return 文によって関数値として呼び出し側に戻される.

More information

I y = f(x) a I a x I x = a + x 1 f(x) f(a) x a = f(a + x) f(a) x (11.1) x a x 0 f(x) f(a) f(a + x) f(a) lim = lim x a x a x 0 x (11.2) f(x) x

I y = f(x) a I a x I x = a + x 1 f(x) f(a) x a = f(a + x) f(a) x (11.1) x a x 0 f(x) f(a) f(a + x) f(a) lim = lim x a x a x 0 x (11.2) f(x) x 11 11.1 I y = a I a x I x = a + 1 f(a) x a = f(a +) f(a) (11.1) x a 0 f(a) f(a +) f(a) = x a x a 0 (11.) x = a a f (a) d df f(a) (a) I dx dx I I I f (x) d df dx dx (x) [a, b] x a ( 0) x a (a, b) () [a,

More information

Taro-プログラミングの基礎Ⅱ(公

Taro-プログラミングの基礎Ⅱ(公 0. 目次 2. プログラムの作成 2. 1 コラッツ問題 自然数 n から出発して n が偶数ならば 2 で割り n が奇数ならば 3 倍して 1 を足す操作を行う この操作を繰り返すと最後に 1 になると予想されている 問題 1 自然数 aの操作回数を求めよ 問題 2 自然数 aから bまでのなかで 最大操作回数となる自然数を求めよ 2. 2 耐久数 正整数の各桁の数字を掛け 得られた結果についても同様の操作を繰り返す

More information

x(t) + t f(t, x) = x(t) + x (t) t x t Tayler x(t + t) = x(t) + x (t) t + 1 2! x (t) t ! x (t) t 3 + (15) Eular x t Teyler 1 Eular 2 Runge-Kutta

x(t) + t f(t, x) = x(t) + x (t) t x t Tayler x(t + t) = x(t) + x (t) t + 1 2! x (t) t ! x (t) t 3 + (15) Eular x t Teyler 1 Eular 2 Runge-Kutta 6 Runge-KuttaEular Runge-Kutta Runge-Kutta A( ) f(t, x) dx dt = lim x(t + t) x(t) t 0 t = f(t, x) (14) t x x(t) t + dt x x(t + dt) Euler 7 t 1 f(t, x(t)) x(t) + f(t + dt, x(t + dt))dt t + dt x(t + dt)

More information

卒 業 研 究 報 告.PDF

卒 業 研 究 報 告.PDF C 13 2 9 1 1-1. 1-2. 2 2-1. 2-2. 2-3. 2-4. 3 3-1. 3-2. 3-3. 3-4. 3-5. 3-5-1. 3-5-2. 3-6. 3-6-1. 3-6-2. 4 5 6 7-1 - 1 1 1-1. 1-2. ++ Lisp Pascal Java Purl HTML Windows - 2-2 2 2-1. 1972 D.M. (Dennis M Ritchie)

More information

Taro-再帰関数Ⅱ(公開版).jtd

Taro-再帰関数Ⅱ(公開版).jtd 0. 目次 6. 2 項係数 7. 二分探索 8. 最大値探索 9. 集合 {1,2,,n} 上の部分集合生成 - 1 - 6. 2 項係数 再帰的定義 2 項係数 c(n,r) は つぎのように 定義される c(n,r) = c(n-1,r) + c(n-1,r-1) (n 2,1 r n-1) = 1 (n 0, r=0 ) = 1 (n 1, r=n ) c(n,r) 0 1 2 3 4 5

More information

, 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

, 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 1 1.1 4n 2 x, x 1 2n f n (x) = 4n 2 ( 1 x), 1 x 1 n 2n n, 1 x n n 1 1 f n (x)dx = 1, n = 1, 2,.. 1 lim 1 lim 1 f n (x)dx = 1 lim f n(x) = ( lim f n (x))dx = f n (x)dx 1 ( lim f n (x))dx d dx ( lim f d

More information

Taro-リストⅠ(公開版).jtd

Taro-リストⅠ(公開版).jtd 0. 目次 1. 再帰的なデータ構造によるリストの表現 1. 1 リストの作成と表示 1. 1. 1 リストの先頭に追加する方法 1. 1. 2 リストの末尾に追加する方法 1. 1. 3 昇順を保存してリストに追加する方法 1. 2 問題 問題 1 問題 2-1 - 1. 再帰的なデータ構造によるリストの表現 リストは データの一部に次のデータの記憶場所を示す情報 ( ポインタという ) を持つ構造をいう

More information

第7章 有限要素法のプログラミング

第7章 有限要素法のプログラミング April 3, 2019 1 / 34 7.1 ( ) 2 Poisson 2 / 34 7.2 femfp.c [1] main( ) input( ) assem( ) ecm( ) f( ) solve( ) gs { solve( ) output( ) 3 / 34 7.3 fopen() #include FILE *fopen(char *fname, char

More information

18 ( ) I II III A B C(100 ) 1, 2, 3, 5 I II A B (100 ) 1, 2, 3 I II A B (80 ) 6 8 I II III A B C(80 ) 1 n (1 + x) n (1) n C 1 + n C

18 ( ) I II III A B C(100 ) 1, 2, 3, 5 I II A B (100 ) 1, 2, 3 I II A B (80 ) 6 8 I II III A B C(80 ) 1 n (1 + x) n (1) n C 1 + n C 8 ( ) 8 5 4 I II III A B C( ),,, 5 I II A B ( ),, I II A B (8 ) 6 8 I II III A B C(8 ) n ( + x) n () n C + n C + + n C n = 7 n () 7 9 C : y = x x A(, 6) () A C () C P AP Q () () () 4 A(,, ) B(,, ) C(,,

More information

: CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and Technology

: CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and Technology I117 8 1 School of Information Science, Japan Advanced Institute of Science and Technology : CR (0x0d) LF (0x0a) line separator CR Mac LF UNIX CR+LF MS-DOS WINDOWS Japan Advanced Institute of Science and

More information

i

i i 3 4 4 7 5 6 3 ( ).. () 3 () (3) (4) /. 3. 4/3 7. /e 8. a > a, a = /, > a >. () a >, a =, > a > () a > b, a = b, a < b. c c n a n + b n + c n 3c n..... () /3 () + (3) / (4) /4 (5) m > n, a b >, m > n,

More information

cpall.dvi

cpall.dvi 55 7 gnuplot gnuplot Thomas Williams Colin Kelley Unix Windows MacOS gnuplot ( ) ( ) gnuplot gnuplot 7.1 gnuplot gnuplot () PC(Windows MacOS ) gnuplot http://www.gnuplot.info gnuplot 7.2 7.2.1 gnuplot

More information

°ÌÁê¿ô³ØII

°ÌÁê¿ô³ØII July 14, 2007 Brouwer f f(x) = x x f(z) = 0 2 f : S 2 R 2 f(x) = f( x) x S 2 3 3 2 - - - 1. X x X U(x) U(x) x U = {U(x) x X} X 1. U(x) A U(x) x 2. A U(x), A B B U(x) 3. A, B U(x) A B U(x) 4. A U(x),

More information

sim0004.dvi

sim0004.dvi 4 : 1 f(x) Z b a dxf(x) (1) ( Double Exponential method=de ) 1 DE N = n T n h h =(b a)=n T n = b a f(a) +f(b) n f + f(a + j b a n )g n j=1 = b a f(a) +f(b) n f + f(a +j b a )g; n n+1 j=1 T n+1 = b a f(a)

More information

QR

QR 1 7 16 13 1 13.1 QR...................................... 2 13.1.1............................................ 2 13.1.2..................................... 3 13.1.3 QR........................................

More information

Microsoft PowerPoint - program.ppt [互換モード]

Microsoft PowerPoint - program.ppt [互換モード] プログラミング演習 バージョン 1 担当教員 : 綴木馴 プログラムの決まりについて学ぶ おすすめする参考書 ザ C 戸川隼人サイエンス社 本日の予定 1. 授業の説明. 2. コンパイラーのインストール. プログラムの決まりについて学ぶ,P31 /* The most in C */ /* hello.c */ printf("hello,world n"); プログラムの決まり ( コメント )

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

D xy D (x, y) z = f(x, y) f D (2 ) (x, y, z) f R z = 1 x 2 y 2 {(x, y); x 2 +y 2 1} x 2 +y 2 +z 2 = 1 1 z (x, y) R 2 z = x 2 y

D xy D (x, y) z = f(x, y) f D (2 ) (x, y, z) f R z = 1 x 2 y 2 {(x, y); x 2 +y 2 1} x 2 +y 2 +z 2 = 1 1 z (x, y) R 2 z = x 2 y 5 5. 2 D xy D (x, y z = f(x, y f D (2 (x, y, z f R 2 5.. z = x 2 y 2 {(x, y; x 2 +y 2 } x 2 +y 2 +z 2 = z 5.2. (x, y R 2 z = x 2 y + 3 (2,,, (, 3,, 3 (,, 5.3 (. (3 ( (a, b, c A : (x, y, z P : (x, y, x

More information

, x R, f (x),, df dx : R R,, f : R R, f(x) ( ).,, f (a) d f dx (a), f (a) d3 f dx 3 (a),, f (n) (a) dn f dx n (a), f d f dx, f d3 f dx 3,, f (n) dn f

, x R, f (x),, df dx : R R,, f : R R, f(x) ( ).,, f (a) d f dx (a), f (a) d3 f dx 3 (a),, f (n) (a) dn f dx n (a), f d f dx, f d3 f dx 3,, f (n) dn f ,,,,.,,,. R f : R R R a R, f(a + ) f(a) lim 0 (), df dx (a) f (a), f(x) x a, f (a), f(x) x a ( ). y f(a + ) y f(x) f(a+) f(a) f(a + ) f(a) f(a) x a 0 a a + x 0 a a + x y y f(x) 0 : 0, f(a+) f(a)., f(x)

More information

6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = N t N 44.1 khz t = 1 sec j t f j {f 0, f 1, f 2,, f N 1

6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = N t N 44.1 khz t = 1 sec j t f j {f 0, f 1, f 2,, f N 1 6 6.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave t T = t 44.1 khz t = 1 sec 44100 j t f j {f 0, f 1, f 2,, f 1 6.2 T {f 0, f 1, f 2,, f 1 T ft) f j = fj t) j = 0, 1, 2,,

More information

Microsoft PowerPoint - 3.ppt [互換モード]

Microsoft PowerPoint - 3.ppt [互換モード] 第 3 回簡単な計算 プリプロセッサ 1 今回の目標 定数とその型を理解する 演算子とその効果を理解する 簡単なライブラリ関数の使用法を理解する ヘロンの公式を用いて 3 角形の面積を求めるプログラムを作成する 2 ヘロンの公式 ヘロンの公式 : 3 辺の長さがわかっているときに 3 角形の面積を求める方法 d = a + b + c 2 S = d ( d a )( d b )( d c ) 3

More information

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL 2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b

(2 Linux Mozilla [ ] [ ] [ ] [ ] URL   2 qkc, nkc ~/.cshrc (emacs 2 set path=($path /usr/meiji/pub/linux/bin tcsh b II 5 (1 2005 5 26 http://www.math.meiji.ac.jp/~mk/syori2-2005/ UNIX (Linux Linux 1 : 2005 http://www.math.meiji.ac.jp/~mk/syori2-2005/jouhousyori2-2005-00/node2. html ( (Linux 1 2 ( ( http://www.meiji.ac.jp/mind/tool/internet-license/

More information

j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E

j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E 8 9 7 6 4 2 3 5 1 j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E a n 1 H = ae l j, j=1 l j = x j+1 x j, x n x 1 = n 1 j=1 l j, l j = ±l l > 0) n 1 H = ϵ l j, j=1 ϵ e x x

More information

DKA ( 1) 1 n i=1 α i c n 1 = 0 ( 1) 2 n i 1 <i 2 α i1 α i2 c n 2 = 0 ( 1) 3 n i 1 <i 2 <i 3 α i1 α i2 α i3 c n 3 = 0. ( 1) n 1 n i 1 <i 2 < <i

DKA ( 1) 1 n i=1 α i c n 1 = 0 ( 1) 2 n i 1 <i 2 α i1 α i2 c n 2 = 0 ( 1) 3 n i 1 <i 2 <i 3 α i1 α i2 α i3 c n 3 = 0. ( 1) n 1 n i 1 <i 2 < <i 149 11 DKA IEEE754 11.1 DKA n p(x) = a n x n + a n 1 x n 1 + + a 0 (11.1) p(x) = 0 (11.2) p n (x) q n (x) = x n + c n 1 x n 1 + + c 1 x + c 0 q n (x) = 0 (11.3) c i = a i a n (i = 0, 1,..., n 1) (11.3)

More information

p = 1, 2, cos 2n + p)πj = cos 2nπj 2n + p)πj, sin = sin 2nπj 7.1) f j = a ) 0 + a p + a n+p cos 2nπj p=1 p=0 1 + ) b n+p p=0 sin 2nπj 1 2 a 0 +

p = 1, 2, cos 2n + p)πj = cos 2nπj 2n + p)πj, sin = sin 2nπj 7.1) f j = a ) 0 + a p + a n+p cos 2nπj p=1 p=0 1 + ) b n+p p=0 sin 2nπj 1 2 a 0 + 7 7.1 sound_wav_files flu00.wav.wav 44.1 khz 1/44100 spwave Text with Time spwave T > 0 t 44.1 khz t = 1 44100 j t f j {f 0, f 1, f 2,, f 1 = T t 7.2 T {f 0, f 1, f 2,, f 1 T ft) f j = fj t) j = 0, 1,

More information

Bessel ( 06/11/21) Bessel 1 ( ) 1.1 0, 1,..., n n J 0 (x), J 1 (x),..., J n (x) I 0 (x), I 1 (x),..., I n (x) Miller (Miller algorithm) Bess

Bessel ( 06/11/21) Bessel 1 ( ) 1.1 0, 1,..., n n J 0 (x), J 1 (x),..., J n (x) I 0 (x), I 1 (x),..., I n (x) Miller (Miller algorithm) Bess Bessel 5 3 11 ( 6/11/1) Bessel 1 ( ) 1.1, 1,..., n n J (x), J 1 (x),..., J n (x) I (x), I 1 (x),..., I n (x) Miller (Miller algorithm) Bessel (6 ) ( ) [1] n n d j J n (x), d j I n (x) Deuflhard j= j=.1

More information

lexex.dvi

lexex.dvi (2018, c ) http://istksckwanseiacjp/ ishiura/cpl/ 4 41 1 mini-c lexc,, 2 testlexc, lexc mini-c 1 ( ) mini-c ( ) (int, char, if, else, while, return 6 ) ( ) (+, -, *, /, %, &, =, ==,!=, >, >=,

More information

pptx

pptx iphone 2010 8 18 C xkozima@myu.ac.jp C Hello, World! Hello World hello.c! printf( Hello, World!\n );! os> ls! hello.c! os> cc hello.c o hello! os> ls! hello!!hello.c! os>./hello! Hello, World!! os>! os>

More information

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

2012 IA 8 I p.3, 2 p.19, 3 p.19, 4 p.22, 5 p.27, 6 p.27, 7 p 2012 IA 8 I 1 10 10 29 1. [0, 1] n x = 1 (n = 1, 2, 3,...) 2 f(x) = n 0 [0, 1] 2. 1 x = 1 (n = 1, 2, 3,...) 2 f(x) = n 0 [0, 1] 1 0 f(x)dx 3. < b < c [, c] b [, c] 4. [, b] f(x) 1 f(x) 1 f(x) [, b] 5.

More information