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 +

Size: px
Start display at page:

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

Transcription

1 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 = 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, 2,, 1; t = T ) ft) ft) 6.1) ft) = 1 2 a 0 + a n cos 2nπt T + b n sin 2nπt ) T j t j = 0, 1, 2,, 1 f j = fj t) = 1 2 a 0 + a n cos 2nπj t + b n sin 2nπj t ) T T = 1 2 a 0 + a n cos 2nπj 39 + b n sin 2nπj ) 7.1)

2 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 + a p a 0 a 1+p p=1 p=0 a 1+p a 1 a 1 b 1+p p=0 b 1+p b 1 b 1 p=0 p=0 f j = a a n cos 2nπj + b n sin 2nπj ) j = 0, 1, 2,, 1) 7.2) 7.3 {f 0, f 1, f 2,, f 1 7.2) a 0 a 1 a 2 a 1 b 1 b 2 b 1 θ = 2π/ i i = 1 n 1 r = e inθ S 1) n = 0 S 2) n 0 S 3) j cos njθ cos n)jθ sin njθ + sin n)jθ 4) f 0 f 1 f 2 f 1 n a n = 1 1 f k cos nkθ, b n = 1 1 f k sin nkθ a n a n b n + b n 40

3 {f 0, f 1, f 2,, f 1 a n = 1 b n = f k cos 2πnk f k sin 2πnk n = 0, 1, 2,, 1) n = 1, 2,, 1) 7.3) θ = 2π/ i i = 1 c n = a n ib n cos nkθ i sin nkθ = e inkθ 7.3) c n = 1 1 f k e inkθ n = 0, 1, 2,, 1) 7.4) b 0 = 0 7.2) a = Re a n cos jnθ + b n sin jnθ) = 1 1 a n cos jnθ + b n sin jnθ) c n e ijnθ j = 0, 1, 2,, 1) 1 Re z z c n e ijnθ 7.4) 1 c n e ijnθ = f k e inkθ ) e ijnθ = f k e ij k)nθ ) 1 e ij k)nθ 1 r = e ij k)θ 1) 2) 1 c n e ijnθ = f k e ij k)nθ ) = f j 7.3) {f 0, f 1, f 2,, f 1 = 2M 3) 4) n = 1, 2,, M 1 a n = a n, a n cos 2nπj = a n cos 41 2 n)πj

4 b n = b n, b n sin 2nπj = b n sin 2 n)πj sin 2Mπj f j = 2a 0) 2 + M 1 = sin πj = 0 7.2) 2a n cos 2nπj + 2b n sin 2nπj ) + a M cos 2Mπj 7.5) j = 0, 1, 2,, 1) 7.4 2a n cos 2nπj + 2b n sin 2nπj 2nπj = 2s n cos ψ n ) s n = a n2 + b n 2, cos ψ n = a n s n, sin ψ n = b n s n 7.5) f j = 2a 0) 2 + M 1 2nπj 2s n cos ψ n ) + a M cos 2Mπj 7.6) j = 0, 1, 2,, 1) 2nπj = 2π n T j t) 2s n {f 0, f 1, f 2,, f 1 n T 2a 0 1 T 2 T M 1 T M T a M { 2a 0, 2s 1, 2s 2,, 2s M 1, a M 7.7) Figure 2.1 flute octave 3 Do Figures harp piano octave 3 Do ) 7.3) 44.1 khz

5 = = 2 k k Fast Fourier Transform FFT FFT FFT FFT ASA FFT 7.3) 1 30 FFT 2 3 FFT fft_h_order.c fft4g_h.c fft h order.c fft4g_h.c n = 1, 2,, M 1 1).txt flu04.txt flu04 2) T f 0 f f 0 f 3) FFT 2 < 2 k k 4) 2 k 4) 2 < 2 k f j = f 0 j = + 1, + 2,, 2 k 1) flu04 flu04_ext.txt 5) FFT rdft, 1, f) FFT rdft, 1, f) 1367 FFT rdft, 1, f) f[0] f[1] f[2] f[-1] f 0 f 1 f 2 f 1 rdft, 1, f) f[0] f[1] f[2] f[-1] 7.5) a 0 a 1 a 2 a M b 1 b 2 b 1 f[2n] = a n n = 0, 1, 2,, M 1 f[1] = a M f[2n+1] = b n n = 1, 2,, M 1 43

6 /* fft_h_order.c */ #include <math.h> #include <stdio.h> #include <string.h> #define MAX 32768) #define MAXH 16387) void rdftint, int, double *); //2^12 = 4096, 2^13 = 8192, 2^14 = 16384, 2^15 = 32768, 2^16 = int main) { int, tmp, M, i, j, k, n, flag, order[maxh+1]; double T, f[max+1], es[maxh+1]; FILE *fp; char file_name[100], file_in[100], file_out[100]; double zero = 0.0, tmp; // 1) printf"filename = "); scanf"%s", file_name); strcpyfile_in, file_name); strcatfile_in, ".txt"); fp = fopenfile_in, "r"); // 2) j = 0; flag = 1; while 1) { flag = fscanffp, "%lf %lf", &T, &f[j]); if flag == EOF) break; j = j+1; = j - 1; fclosefp); printf"origial: = %d T = %f\n",, T); f[0] = f[0] + f[])/2.0; f[] = f[0]; // 3) k = log)/log2.0); if pow2, k) < ) k = k + 1; tmp = pow2, k); // 4) 2 if tmp > ) { forj = + 1; j <= tmp; j++) f[j] = f[0]; T = T*tmp)/; = tmp; printf"added: = %d T = %f\n",, T); strcpyfile_out, file_name); strcatfile_out, "_ext.txt"); fp = fopenfile_out, "w"); forj = 0; j <= ; j++) fprintffp, "%f %f\n", j*t/, f[j]); fclosefp); // 5) FFT rdft, 1, f); // a[n] = f[2*n]*2.0/ n = 0, 1, 2,..., M-1) // a[m] = f[1]/ // b[n] = f[2*n+1]*2.0/ n = 1, 2, 3,..., M-1) // b[0] = b[m] = 0 44

7 // 6) M = /2; es[0] = fabsf[0])*2.0/; es[m] = fabsf[1])/; for n = 1; n < M; n++) { es[n] = sqrtf[2*n]*f[2*n]+f[2*n+1]*f[2*n+1])*2.0/; // 7) for n = 0; n <= M; n++) order[n] = n; for n = 2; n < M; n++) { for k = 1; k < n; k++) if es[k] < es[n]) break; tmp = es[n]; for i = n; i > k; i--) { es[i] = es[i-1]; order[i] = order[i-1]; es[k] = tmp; order[k] = n; // 8) strcpyfile_out, file_name); strcatfile_out, "_FFT.txt"); fp = fopenfile_out, "w"); n = 0; fprintffp, "%d %d %f %f %f %f %f %f\n",, n, n/t, f[n]*2.0/, zero, es[n], es[n]/es[1], T); fprintffp, "%d %d %f %f %f %f %f\n", M, M, M/T, f[1]/, zero, es[m], es[m]/es[1]); for k = 1; k < M; k++) { n = order[k]; fprintffp, "%d %d %f %f %f %f %f\n", k, n, n/t, f[2*n]*2.0/, f[2*n+1]*2.0/, es[k], es[k]/es[1]); return 0; 6) es[0] es[1] es[2] es[m] 7.7) a 0 s 1 s M 1 a M es[0] = 2a 0 es[n] = 2s n n = 1, 2,, M 1 es[m] = a M 7) n = 1, 2,, 1 8) 1) flu04 flu04_fft.txt 1 T n = T 2a 0 0 2a 0 2a 0 2s max T s max s 1 s 2 s 1 2 n = M 45

8 M M M T a M 0 a M a M 2s max 3 n = 1, 2,, 1 n 2s 1 2s 2 2s M 1 k 2s n k+2 k n n T 2a n 2b n 2s n 2s n 3 n T 2s max Figure 7.1: octave 4 Do flute harp piano tuba violin csc10.tar Linux flu04.txt har04.txt pia04.txt 46

9 tub04.txt vio04.txt flute harp piano tuba violin octave 4 Do fft_h_order.c fft_h_order./run.sh Linux flute octave 4 Do fft_h_order flu04 flu04.txt flu04_fft.txt 2s max Figure 7.1 flute octave 4 Do gnuplot Linux harp piano tuba violin octave 4 Do gnuplot Figure {f 0, f 1, f 2,, f 1 7.2) a 0 a 1 a 2 a 1 b 1 b 2 b 1 7.3) a 0 a 1 a 2 a M b 1 b 2 b M 1 7.2) 7.5) 7.6) {f 0, f 1, f 2,, f 1 = 2M a n =a n b n = b n 7.6) n = 1, 2,, M 1 f j = 2a 0) 2 + a M cos 2Mπj M 1 + ) 2nπj 2s n cos ψ n j = 0, 1, 2,, 1) s max s 1 s 2 s 1 s n > s max /2 n f [1] j j = 0, 1, 2,, 1 f [1] j = 2a 0) + a M cos 2Mπj 2 + ) 2nπj 2s n cos ψ n. s n >s max /2 m = 2, 3, s n > s max /2 m n f [m] j j = 0, 1, 2,, 1 f [m] j = 2a 0) + a M cos 2Mπj 2 + ) 2nπj 2s n cos ψ n. s n >s max /2 m 47

10 { idft.c idft.c f [m] 0, f [m] 1,, f [m] 1 m 7.2) { 7.5) 7.6) {f 0, f 1,, f 1 f [m] 0, f [m] 1,, f [m] 1 m = 1, 2,, 9 1) fft_h_order.c 8) flu04.txt flu04_fft 2) a[0] a[1] a[2] a[m] b[1] b[2] b[m-1] 7.5) a 0 a 1 a 2 a M b 1 b 2 b M 1 a[n] = 2a n n = 0, 1, 2,, M 1 a[m] = a M b[n] = 2b n n = 1, 2,, M 1 /* idfc.c */ #include <stdio.h> #include <math.h> #include <string.h> #define MAX 32768) #define MAXH 16387) int main ) { int, M, i, j, k, n, flag, order[maxh+1]; double T, f[max+1], a[maxh+1], b[maxh+1], es[maxh+1]; FILE *fp; char file_name[100], file_in[100], file_out[100], file_add[100]; int ktmp1, ktmp2; double dt, dtmp1, dtmp2, dtmp3, dtmp4, dtmp5; // 1) printf"filename = "); scanf"%s", file_name); strcpyfile_in, file_name); strcatfile_in, ".txt"); fp = fopenfile_in, "r"); // 2) fscanffp, "%d %d %lf %lf %lf %lf %lf %lf", &, &ktmp2, &dtmp1, &a[0], &dtmp2, &dtmp3, &dtmp4, &T); fscanffp, "%d %d %lf %lf %lf %lf %lf", &ktmp1, &ktmp2, &dtmp1, &dtmp2, &dtmp3, &dtmp4, &dtmp5); M = ktmp1; a[m] = dtmp2; k = 1; flag = 1; while 1) { flag = fscanffp, "%d %d %lf %lf %lf %lf %lf", &ktmp1, &n, &dtmp1, &dtmp2, &dtmp3, &dtmp4, &es[k]); if flag == EOF) break; order[k] = n; a[n] = dtmp2; b[n] = dtmp3; k = k+1; fclosefp); 48

11 // 3) dt = T/; for j = 0; j <= ; j++) f[j] = a[0]/2.0 + a[m]*cos2.0*m*m_pi*j/); k = 1; dtmp1 = 1.0; for i = 0; i <= 8; i++) { dtmp1 = dtmp1/2.0; printf"i = %d: ", i, k); while es[k]/es[1] >= dtmp1) { n = order[k]; for j = 0; j <= ; j++) f[j] = f[j] + a[n]*cos2.0*n*m_pi*j/) + b[n]*sin2.0*n*m_pi*j/); k = k + 1; if k > M) break; strcpyfile_out, file_name); sprintffile_add, "_IDFT%1d%05d.txt", i+1, k-1); strcatfile_out, file_add); fp = fopenfile_out, "w"); for j = 0; j <= ; j++) fprintffp, "%f %f\n", j*dt, f[j]); fclosefp); printf"%s includes until %d\n", file_out, k-1); return 0; 3) 1) flu04_fft s n > s max /2 n 9 s n > s max /2 2 n 21 s n > s max /2 3 n 40 s n > s max /2 9 n 827 { f [1] 0, f [1] 1,, f [1] flu04_fft_idft txt { f [2] 0, f [2] 1,, f [2] flu04_fft_idft txt { f [3] 0, f [3] 1,, f [3] flu04_fft_idft txt { f [9] 0, f [9] 1,, f [9] flu04_fft_idft txt f [m] idft.c idft cc -O2 idft.c -lm -o idft = f [m] 0 m = 1, 2,, 9 49

12 Linux & Windows flute octave 4 Do Linux idft flu04_fft flute octave 4 Do 9 flu04_fft_idft txt flu04_fft_idft txt flu04_fft_idft txt 9 flu04.txt Windows spwave spwave flu04_fft_idft txt Text with Time Linux & Windows Linux idft har04_fft harp octave 4 Do pia04_fft tub04_fft vio04_fft piano tuba violin octave 4 Do Windows spwave sound wav files cats dogs Windows sound_wav_files sound_wav_files_cats_dogs Windows.wav flu02.wav flute octave 3 Mi 9 1) 3) 8) Windows 5) 6) Linux 4) 7) Windows Linux 1) spwave flu02.wav 2) ) Text with Time.txt 50

13 4) Linux 5) fft_h_order FFT FFT 6) idft 7) 6) Windows 8) spwave Windows Linux & Windows 1) 8) flu01.wav flu02.wav flu03.wav flu05.wav flu06.wav flu07.wav har01.wav har02.wav har03.wav har05.wav har06.wav har07.wav pia01.wav pia02.wav pia03.wav pia05.wav pia06.wav pia07.wav tub01.wav tub02.wav tub03.wav tub05.wav tub06.wav tub07.wav vio01.wav vio02.wav vio03.wav vio05.wav vio06.wav vio07.wav 3 Windows Linux & Windows sound_wav_files_cats_dogs cat1.wav cat2.wav cat3.wav cat4.wav cat1.wav cat4.wav 3 1 1) 8) set terminal postscript set output "filename.ps" replot set terminal postscript eps color 51

14 set output "filename.eps" replot filename Windows Linux & Windows sound_wav_files_cats_dogs 1) 8) dog1.wav dog2.wav dog3.wav dog4.wav dog b1.wav dog b2.wav dog b3.wav dog b4.wav dog b5.wav dog b6.wav dog b7.wav dog b8.wav dog b9.wav dog bss1.wav dog bss2.wav dog bss3.wav dog bss4.wav dog1.wav dog2.wav dog3.wav dog4.wav dog b1.wav dog b2.wav dog b3.wav dog b4.wav dog b5.wav dog b6.wav dog b7.wav dog b8.wav dog b9.wav 3 dog3.wav dog4.wav dog bss1.wav dog bss4.wav springer spaniel Windows Linux & Windows

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

[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

£Ã¥×¥í¥°¥é¥ß¥ó¥°(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

/* 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

: 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

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

(5 B m e i 2π T mt m m B m e i 2π T mt m m B m e i 2π T mt B m (m < 0 C m m (6 (7 (5 g(t C 0 + m C m e i 2π T mt (7 C m e i 2π T mt + m m C m e i 2π T

(5 B m e i 2π T mt m m B m e i 2π T mt m m B m e i 2π T mt B m (m < 0 C m m (6 (7 (5 g(t C 0 + m C m e i 2π T mt (7 C m e i 2π T mt + m m C m e i 2π T 2.6 FFT(Fast Fourier Transform 2.6. T g(t g(t 2 a 0 + { a m b m 2 T T 0 2 T T 0 (a m cos( 2π T mt + b m sin( 2π mt ( T m 2π g(t cos( T mtdt m 0,, 2,... 2π g(t sin( T mtdt m, 2, 3... (2 g(t T 0 < t < T

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

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1:

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1: 005 9 7 1 1.1 1 Hello World!! 5 p r i n t f ( H e l l o World!! \ n ) ; 7 return 0 ; 8 } 1: 1 [ ] Hello World!! from Akita National College of Technology. 1 : 5 p r i n t f ( H e l l o World!! \ n ) ;

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

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

新版明解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

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

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

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

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

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

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 C 1 / 21 C 2005 A * 1 2 1.1......................................... 2 1.2 *.......................................... 3 2 4 2.1.............................................. 4 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

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (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

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B A/B (2018/10/19) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2018/soft/soft.html 2018 10 19 A/B 1 2018 10 19 2 1 1 1.1 OHP.................................... 1

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

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

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

1.3 2 gnuplot> set samples gnuplot> plot sin(x) sin gnuplot> plot [0:6.28] [-1.5:1.5] sin(x) gnuplot> plot [-6.28:6.28] [-1.5:1.5] sin(x),co

1.3 2 gnuplot> set samples gnuplot> plot sin(x) sin gnuplot> plot [0:6.28] [-1.5:1.5] sin(x) gnuplot> plot [-6.28:6.28] [-1.5:1.5] sin(x),co gnuplot 8 gnuplot 1 1.1 gnuplot gnuplot 2D 3D gnuplot ( ) gnuplot UNIX Windows Machintosh Excel gnuplot C 1.2 web gnuplot $ gnuplot gnuplot gnuplot> exit 1 1.3 2 gnuplot> set samples 1024 1024 gnuplot>

More information

プログラミング基礎

プログラミング基礎 C プログラミング 演習 アルゴリズム基礎論 演習 第 10 回 今後の予定 12/22( 月 ) 期末試験 (60 分間 ) 場所 :A1611 時間 :16:20~17:20 課題の最終提出締切 :12/19( 金 ) これ以降の新規提出は評価されない 12/22までに最終状況を提示するので, 提出したのに や になってる人は自分の提出内容や提出先を再確認した上で12/26までに問い合わせること

More information

2014 3 10 5 1 5 1.1..................................... 5 2 6 2.1.................................... 6 2.2 Z........................................ 6 2.3.................................. 6 2.3.1..................

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó  ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡ (2018) 2018 5 24 ( ) while ( ) do while ( ); for ( ; ; ) while int i = 0; while (i < 100) { printf("i = %3d\n", i); i++; while int i = 0; i while (i < 100) { printf("i = %3d\n", i); i++; while int i =

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

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

‚æ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

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

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

gengo1-12

gengo1-12 外部変数 関数の外で定義される変数を外部変数 ( 大域変数 ) と呼ぶ 外部変数のスコープは広域的 ( プログラム全体 ) 全ての関数で参照可能 int a=10; double x=3.14159; printf( a = %d\n, a); sample(); printf( %f\n, x); void sample(void) printf( %f\n, x); x += 1.0; 外部変数

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

program.dvi

program.dvi 2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation

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

コンピュータ概論

コンピュータ概論 4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50 1. 2 1 10 3. 0 360 10 sin() 4.1.2 For

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

Microsoft PowerPoint - 14Gnuplot.ppt

Microsoft PowerPoint - 14Gnuplot.ppt Gnuplot との連携 Gnuplot による関数の描画 Gnuplot によるデータのプロット Gnuplot による 3-D グラフの描画 Gnuplot による 3-D データのプロット 今日のポイント グラフ描画ソフト gnuplot を体験してみよう Gnuplot とは グラフ描画専用のフリーウェア Windows 版の名称は wgnuplot インストールはフォルダごとコピーするだけ

More information

gengo1-12

gengo1-12 外部変数 関数の外で定義される変数を外部変数 ( 大域変数 ) と呼ぶ 外部変数のスコープは広域的 ( プログラム全体 ) 全ての関数で参照可能 int a=10; double x=3.14159; printf( a = %d\n, a); sample(); printf( %f\n, x); void sample(void) printf( %f\n, x); x += 1.0; 外部変数

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

2014計算機実験1_1

2014計算機実験1_1 H26 1 1 1 seto@ics.nara-wu.ac.jp 数学モデリングのプロセス 問題点の抽出 定義 仮定 数式化 万有引力の法則 m すべての物体は引き合う r mm F =G 2 r M モデルの検証 モデルによる 説明 将来予測 解釈 F: 万有引力 (kg m s-2) G: 万有引力定数 (m s kg ) 解析 数値計算 M: 地球の質量 (kg) により解を得る m: 落下する物質の質量

More information

橡Pro PDF

橡Pro PDF 1 void main( ) char c; /* int c; */ int sum=0; while ((c = getchar())!= EOF) if(isdigit(c) ) sum += (c-'0'); printf("%d\n", sum); main()int i,sum=0; for(i=0;i

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

gengo1-12

gengo1-12 外部変数 関数の外で定義される変数を外部変数 ( 大域変数 ) と呼ぶ 外部変数のスコープは広域的 ( プログラム全体 ) 全ての関数で参照可能 int a=10; double x=3.14159; printf( a = %d\n, a); sample(); printf( %f\n, x); void sample(void) printf( %f\n, x); x += 1.0; 外部変数

More information

t 2 2 t 2 t F ( ) p- 2 2 F 2 G F ( ) 2 2 F 2 G F ( ) 2 2 2

t 2 2 t 2 t F ( ) p- 2 2 F 2 G F ( ) 2 2 F 2 G F ( ) 2 2 2 1 2 2 0 1 2 2 2 2 2 2 2 2.1 2 2 F={f ij }, G {g ij } t f ij t g ij = 1 f ij < t g ij = 0 t p- p S 0 S p = S 0 /S t p 2 t 1 t 2 2 t 2 t 2 2 3 3 1 2 F ( ) p- 2 2 F 2 G 3 2 2 F ( ) 2 2 F 2 G 3 3 2 F ( ) 2

More information

ファイル入出力

ファイル入出力 C プログラミング Ⅱ の基礎 とは ファイルへデータを書き込んだり ( 出力 ), ファイルからデータを読み込んだり ( 入力 ) する C 言語では キーボードからの入力 画面への出力と同じようなコードで 処理を実現できる プログラム 入力 出力 ファイル 出力 入力 2 入出力の基本 ストリーム プログラム上で様々な装置への入出力を行う機構様々な入出力装置を統一的な方法で扱うことができる ハードディスクなどではファイルデータによって入出力が行われる

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

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

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l C/C++ 2007 6 18 1 C STL(1) 2 1.1............................................... 2 1.2 stdio................................................ 3 1.3.......................................... 10 2 11 2.1 sizeof......................................

More information

新・明解C言語 実践編

新・明解C言語 実践編 第 1 章 見 21 1-1 見えないエラー 見 List 1-1 "max2x1.h" a, b max2 List 1-1 chap01/max2x1.h max2 "max2x1.h" #define max2(a, b) ((a) > (b)? (a) : (b)) max2 List 1-2 List 1-2 chap01/max2x1test.c max2 #include

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

第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

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

Informatics 2014

Informatics 2014 C 計算機の歴史 手回し計算機 新旧のソロバン バベッジの階差機関 スパコン ENIAC (1946) パソコン 大型汎用計算機 電卓 現在のコンピュータ Input Output Device Central Processing Unit I/O CPU Memory OS (Operating System) OS Windows 78, Vista, XP Windows Mac OS X

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

untitled

untitled Q 8 1 8.1 (C++) C++ cin cout 5 C++ 16 6 p.63 8.3 #include 7 showbase noshowbase showpoint noshowpoint 8.3 uppercase 16 nouppercase 16 setfill(int) setprecision(int) setw(int) setbase(int) dec

More information

12.2 電気回路網に関するキルヒホッフの法則による解法 2 多元連立 1 次方程式の工学的応用についての例を 2 つ示す.1 つはブリッジ T 型回路, もう 1 つはホーイストンブリッジ回路である. 示された回路図と与えられた回路定数からキルヒホッフの法則を使って多元連立 1 次方程式を導出する

12.2 電気回路網に関するキルヒホッフの法則による解法 2 多元連立 1 次方程式の工学的応用についての例を 2 つ示す.1 つはブリッジ T 型回路, もう 1 つはホーイストンブリッジ回路である. 示された回路図と与えられた回路定数からキルヒホッフの法則を使って多元連立 1 次方程式を導出する 12.2 電気回路網に関するキルヒホッフの法則による解法 2 多元連立 1 次方程式の工学的応用についての例を 2 つ示す.1 つはブリッジ T 型回路, もう 1 つはホーイストンブリッジ回路である. 示された回路図と与えられた回路定数からキルヒホッフの法則を使って多元連立 1 次方程式を導出する. その式のパラメータを前述のプログラムに反映させてシミュレーションを行う. 12.2.0 キルヒホッフの法則

More information

XMPによる並列化実装2

XMPによる並列化実装2 2 3 C Fortran Exercise 1 Exercise 2 Serial init.c init.f90 XMP xmp_init.c xmp_init.f90 Serial laplace.c laplace.f90 XMP xmp_laplace.c xmp_laplace.f90 #include int a[10]; program init integer

More information

. (.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(

. (.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 8. (.8.)............................................................................................3.............................................4 Nermark β..........................................

More information

1 $ cat aboutipa 2 IPA is a Japanese quasi-government 3 organization established in accor- 4 dance with The Law for Information 5 Processing Technolog

1 $ cat aboutipa 2 IPA is a Japanese quasi-government 3 organization established in accor- 4 dance with The Law for Information 5 Processing Technolog 1 $ cat aboutipa 2 IPA is a Japanese quasi-government 3 organization established in accor- 4 dance with The Law for Information 5 Processing Technology Promotion, 6 (Law No.90, May 22, 1979). 7 $./upper

More information

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() 2 double *a[ ]; double 1 malloc() dou 1 1.1 C 2 1 double a[ ][ ]; 1 3x3 0 1 3x3 ( ) 0.240 0.143 0.339 0.191 0.341 0.477 0.412 0.003 0.921 1.2 malloc() 2 double *a[ ]; double 1 malloc() double 1 malloc() free() 3 #include #include

More information

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

Microsoft PowerPoint - 11th.ppt [互換モード] 工学部 6 7 8 9 10 組 ( 奇数学籍番号 ) 担当 : 長谷川英之 情報処理演習 第 11 回 2010 年 12 月 16 日 1 課題 R1-20101125 の解答例 #include #include #define nn 90000 #define pi 3.1415 main() int i,j,n; float sound[nn],ei[nn],er[nn];

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

ファイル入出力

ファイル入出力 C プログラミング Ⅱ の基礎 とは ファイルへデータを書き込んだり ( 出力 ), ファイルからデータを読み込んだり ( 入力 ) する C 言語では キーボードからの入力 画面への出力と同じようなコードで 処理を実現できる プログラム 入力 出力 ファイル 出力 入力 2 入出力の基本 ストリーム プログラム上で様々な装置への入出力を行う機構様々な入出力装置を統一的な方法で扱うことができる ハードディスクなどではファイルデータによって入出力が行われる

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

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko

More information

[1] 1.1 x(t) t x(t + n ) = x(t) (n = 1,, 3, ) { x(t) : : 1 [ /, /] 1 x(t) = a + a 1 cos πt + a cos 4πt + + a n cos nπt + + b 1 sin πt + b sin 4πt = a

[1] 1.1 x(t) t x(t + n ) = x(t) (n = 1,, 3, ) { x(t) : : 1 [ /, /] 1 x(t) = a + a 1 cos πt + a cos 4πt + + a n cos nπt + + b 1 sin πt + b sin 4πt = a 13/7/1 II ( / A: ) (1) 1 [] (, ) ( ) ( ) ( ) etc. etc. 1. 1 [1] 1.1 x(t) t x(t + n ) = x(t) (n = 1,, 3, ) { x(t) : : 1 [ /, /] 1 x(t) = a + a 1 cos πt + a cos 4πt + + a n cos nπt + + b 1 sin πt + b sin

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

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

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

関数の呼び出し ( 選択ソート ) 選択ソートのプログラム (findminvalue, findandreplace ができているとする ) #include <stdio.h> #define InFile "data.txt" #define OutFile "sorted.txt" #def

関数の呼び出し ( 選択ソート ) 選択ソートのプログラム (findminvalue, findandreplace ができているとする ) #include <stdio.h> #define InFile data.txt #define OutFile sorted.txt #def C プログラミング演習 1( 再 ) 6 講義では C プログラミングの基本を学び 演習では やや実践的なプログラミングを通して学ぶ 関数の呼び出し ( 選択ソート ) 選択ソートのプログラム (findminvalue, findandreplace ができているとする ) #include #define InFile "data.txt" #define OutFile "sorted.txt"

More information

講習No.12

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

More information

#A A A F, F d F P + F P = d P F, F y P F F x A.1 ( α, 0), (α, 0) α > 0) (x, y) (x + α) 2 + y 2, (x α) 2 + y 2 d (x + α)2 + y 2 + (x α) 2 + y 2 =

#A A A F, F d F P + F P = d P F, F y P F F x A.1 ( α, 0), (α, 0) α > 0) (x, y) (x + α) 2 + y 2, (x α) 2 + y 2 d (x + α)2 + y 2 + (x α) 2 + y 2 = #A A A. F, F d F P + F P = d P F, F P F F A. α, 0, α, 0 α > 0, + α +, α + d + α + + α + = d d F, F 0 < α < d + α + = d α + + α + = d d α + + α + d α + = d 4 4d α + = d 4 8d + 6 http://mth.cs.kitmi-it.c.jp/

More information

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D

Minimum C Minimum C Minimum C BNF T okenseq W hite Any D 6 2019 5 14 6.1 Minimum C....................... 6 1 6.2....................................... 6 7 6.1 Minimum C Minimum C BNF T okenseq W hite Any Digit ::= 0 1 2... 9. Number ::= Digit Digit. Alphabet

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

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

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

スライド 1 数値解析 平成 24 年度前期第 13 週 [7 月 11 日 ] 静岡大学創造科学技術大学院情報科学専攻工学部機械工学科計測情報講座 三浦憲二郎 講義アウトライン [7 月 11 日 ] 関数近似と補間 最小 2 乗近似による関数近似 ラグランジュ補間 形状処理工学の基礎 点列からの曲線の生成 T.Kanai, U.Tokyo 関数近似 p.116 複雑な関数を簡単な関数で近似する関数近似 閉区間

More information

file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose

filea fileb fp = fopen(a, r); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen(b, r); while(fgets(line, BUFSIZ, fp)) {... fclose I117 9 2 School of Information Science, Japan Advanced Institute of Science and Technology file"a" file"b" fp = fopen("a", "r"); while(fgets(line, BUFSIZ, fp)) {... fclose(fp); fp = fopen("b", "r"); while(fgets(line,

More information

G1. tateyama~$ gcc -c xxxxx.c ( ) xxxxx.o tateyama~$ gcc -o xxxxx.o yyyyy.o..... zzzzz.o Makefile make Makefile : xxxxx.o yyyyy.o... zzzzz.o ; gcc -o

G1. tateyama~$ gcc -c xxxxx.c ( ) xxxxx.o tateyama~$ gcc -o xxxxx.o yyyyy.o..... zzzzz.o Makefile make Makefile : xxxxx.o yyyyy.o... zzzzz.o ; gcc -o G1. tateyama~$ gcc -c xxxxx.c ( ) xxxxx.o tateyama~$ gcc -o xxxxx.o yyyyy.o..... zzzzz.o Makefile make Makefile : xxxxx.o yyyyy.o... zzzzz.o ; gcc -o xxxxx.o yyyyy.o... zzzzz.o [1] [5] 1 [1] (matrix multi

More information

情報活用資料

情報活用資料 y = Asin 2πt T t t = t i i 1 n+1 i i+1 Δt t t i = Δt i 1 ( ) y i = Asin 2πt i T 21 (x, y) t ( ) x = Asin 2πmt y = Asin( 2πnt + δ ) m, n δ (x, y) m, n 22 L A x y A L x 23 ls -l gnuplot gnuplot> plot "sine.dat"

More information

練習&演習問題

練習&演習問題 練習問題 ファイル入出力 練習問題 1 ファイルへのデータ出力 配列 a[ ] の値をファイル data.txt に出力するプログラムを作成しなさい #include #include /* srand(), rand() */ #include /* time() */ int main(void) { int i; double a[5];

More information

II No.01 [n/2] [1]H n (x) H n (x) = ( 1) r n! r!(n 2r)! (2x)n 2r. r=0 [2]H n (x) n,, H n ( x) = ( 1) n H n (x). [3] H n (x) = ( 1) n dn x2 e dx n e x2

II No.01 [n/2] [1]H n (x) H n (x) = ( 1) r n! r!(n 2r)! (2x)n 2r. r=0 [2]H n (x) n,, H n ( x) = ( 1) n H n (x). [3] H n (x) = ( 1) n dn x2 e dx n e x2 II No.1 [n/] [1]H n x) H n x) = 1) r n! r!n r)! x)n r r= []H n x) n,, H n x) = 1) n H n x) [3] H n x) = 1) n dn x e dx n e x [4] H n+1 x) = xh n x) nh n 1 x) ) d dx x H n x) = H n+1 x) d dx H nx) = nh

More information

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

Microsoft Word - Cプログラミング演習(9) 第 9 回 (6/18) 3. ファイルとその応用 外部記憶装置に記録されたプログラムやデータを, ファイルと呼ぶ シーケンシャルファイルやランダムファイルへのデータの記録や読み出し, 更新の手順について学習する (1) ファイルとレコードファイル複数の関連したデータを一つに集めたり プログラムを外部記憶装置に保存したものレコードファイルを構成する一塊のデータ ex. 個人カードフィールドレコードを構成する個別の要素

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

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

OHP.dvi

OHP.dvi 0 7 4 0000 5.. 3. 4. 5. 0 0 00 Gauss PC 0 Gauss 3 Gauss Gauss 3 4 4 4 4 3 4 4 4 4 3 4 4 4 4 3 4 4 4 4 u [] u [3] u [4] u [4] P 0 = P 0 (),3,4 (,), (3,), (4,) 0,,,3,4 3 3 3 3 4 4 4 4 0 3 6 6 0 6 3 6 0 6

More information

価格変動のフラクタル性への統計物理的アプローチ

価格変動のフラクタル性への統計物理的アプローチ 2000 2 29 1 1 4 2 6 3 7 3.1............................. 7 3.2........... 7 3.3............. 7 3.4.................... 8 3.4.1.......................... 8 3.4.2.......................... 8 3.4.3.................

More information

kiso2-09.key

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

More information

joho12.ppt

joho12.ppt n φ 1 (x),φ 2 (x),,φ n (x) (x i, f i ) Q n c 1,,c n (,f k ) q n = c i φ i (x) x Q n i=1 c 1 = 0 c 1 n ( c 1 ) = q n f k 2 Q n ( c 1 ) = q 2 2 n ( ) 2 f k q n ( ) + f k Q n c 1 = c 1 q n 2 q n( ) q n q

More information

main.dvi

main.dvi 6 FIR FIR FIR FIR 6.1 FIR 6.1.1 H(e jω ) H(e jω )= H(e jω ) e jθ(ω) = H(e jω ) (cos θ(ω)+jsin θ(ω)) (6.1) H(e jω ) θ(ω) θ(ω) = KωT, K > 0 (6.2) 6.1.2 6.1 6.1 FIR 123 6.1 H(e jω 1, ω

More information

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B A/B (2010/10/08) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2010/soft/soft.html 2010 10 8 A/B 1 2010 10 8 2 1 1 1.1 OHP.................................... 1 1.2.......................................

More information

9 5 ( α+ ) = (α + ) α (log ) = α d = α C d = log + C C 5. () d = 4 d = C = C = 3 + C 3 () d = d = C = C = 3 + C 3 =

9 5 ( α+ ) = (α + ) α (log ) = α d = α C d = log + C C 5. () d = 4 d = C = C = 3 + C 3 () d = d = C = C = 3 + C 3 = 5 5. 5.. A II f() f() F () f() F () = f() C (F () + C) = F () = f() F () + C f() F () G() f() G () = F () 39 G() = F () + C C f() F () f() F () + C C f() f() d f() f() C f() f() F () = f() f() f() d =

More information

ープのロープ長以下であれば実現可能である ケース 3: 3 本のロープの杭の位置を点 P 1 = (x 1, y 1, 0), 点 P 2 = (x 2, y 2, 0), 点 P 3 = (x 3, y 3, 0) とする 点 P 1 = (x 1, y 1, 0), 点 P 2 = (x 2,

ープのロープ長以下であれば実現可能である ケース 3: 3 本のロープの杭の位置を点 P 1 = (x 1, y 1, 0), 点 P 2 = (x 2, y 2, 0), 点 P 3 = (x 3, y 3, 0) とする 点 P 1 = (x 1, y 1, 0), 点 P 2 = (x 2, ACM ICPC2013 国内予選問題 E つながれた風船 風船が最も高くあがるケースとして 1. 一本のロープが垂直に延びて他の2 本は緩んでいる 2. 二本のロープがピンと張っており残りの1 本は緩んでいる 3. 三本のロープともピンとはっているの三つのケースが考えられる ロープの本数は高々 10 本なので ケース1 は高々 10 9C2=360 通り ケース2も高々 10C2 8=360 通り

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

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

1 3 1.1.......................... 3 1............................... 3 1.3....................... 5 1.4.......................... 6 1.5........................ 7 8.1......................... 8..............................

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