joho09.ppt

Similar documents
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 Word - 03-数値計算の基礎.docx

1 (1) ( i ) 60 (ii) 75 (iii) 315 (2) π ( i ) (ii) π (iii) 7 12 π ( (3) r, AOB = θ 0 < θ < π ) OAB A 2 OB P ( AB ) < ( AP ) (4) 0 < θ < π 2 sin θ

USB ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231

70 : 20 : A B (20 ) (30 ) 50 1

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

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

joho12.ppt

<4D F736F F D B B83578B6594BB2D834A836F815B82D082C88C60202E646F63>

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)

or a 3-1a (0 b ) : max: a b a > b result a result b ( ) result Python : def max(a, b): if a > b: result = a else: result = b ret

(2000 )

t θ, τ, α, β S(, 0 P sin(θ P θ S x cos(θ SP = θ P (cos(θ, sin(θ sin(θ P t tan(θ θ 0 cos(θ tan(θ = sin(θ cos(θ ( 0t tan(θ

, 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

2009 IA 5 I 22, 23, 24, 25, 26, (1) Arcsin 1 ( 2 (4) Arccos 1 ) 2 3 (2) Arcsin( 1) (3) Arccos 2 (5) Arctan 1 (6) Arctan ( 3 ) 3 2. n (1) ta

c-all.dvi

- II

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

i

all.dvi

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

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

sim0004.dvi

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

untitled

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

1 8, : 8.1 1, 2 z = ax + by + c ax by + z c = a b +1 x y z c = 0, (0, 0, c), n = ( a, b, 1). f = n i=1 a ii x 2 i + i<j 2a ij x i x j = ( x, A x), 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

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

1.1 ft t 2 ft = t 2 ft+ t = t+ t d t 2 t + t 2 t 2 = lim t 0 t = lim t 0 = lim t 0 t 2 + 2t t + t 2 t 2 t + t 2 t 2t t + t 2 t 2t + t = lim t 0

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

mugensho.dvi

N88 BASIC 0.3 C: My Documents 0.6: 0.3: (R) (G) : enterreturn : (F) BA- SIC.bas 0.8: (V) 0.9: 0.5:

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

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

No2 4 y =sinx (5) y = p sin(2x +3) (6) y = 1 tan(3x 2) (7) y =cos 2 (4x +5) (8) y = cos x 1+sinx 5 (1) y =sinx cos x 6 f(x) = sin(sin x) f 0 (π) (2) y

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

P02.ppt

IA 2013 : :10722 : 2 : :2 :761 :1 (23-27) : : ( / ) (1 /, ) / e.g. (Taylar ) e x = 1 + x + x xn n! +... sin x = x x3 6 + x5 x2n+1 + (

num3.dvi

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

1 θ i (1) A B θ ( ) A = B = sin 3θ = sin θ (A B sin 2 θ) ( ) 1 2 π 3 < = θ < = 2 π 3 Ax Bx3 = 1 2 θ = π sin θ (2) a b c θ sin 5θ = sin θ f(sin 2 θ) 2

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble

Microsoft Word - 触ってみよう、Maximaに2.doc

(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

2000年度『数学展望 I』講義録

programmingII2019-v01

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


1 4 2 EP) (EP) (EP)

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

DOPRI5.dvi

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

all.dvi

PSCHG000.PS

超初心者用

資料

) 9 81

ac b 0 r = r a 0 b 0 y 0 cy 0 ac b 0 f(, y) = a + by + cy ac b = 0 1 ac b = 0 z = f(, y) f(, y) 1 a, b, c 0 a 0 f(, y) = a ( ( + b ) ) a y ac b + a y

高等学校学習指導要領解説 数学編

A S- hara/lectures/lectures-j.html r A = A 5 : 5 = max{ A, } A A A A B A, B A A A %

C

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

DVIOUT

I, II 1, A = A 4 : 6 = max{ A, } A A 10 10%

6. Euler 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

( ) x y f(x, y) = ax

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 I

2014 S hara/lectures/lectures-j.html r 1 S phone: ,

19 Systematization of Problem Solving Strategy in High School Mathematics for Improving Metacognitive Ability

CALCULUS II (Hiroshi SUZUKI ) f(x, y) A(a, b) 1. P (x, y) A(a, b) A(a, b) f(x, y) c f(x, y) A(a, b) c f(x, y) c f(x, y) c (x a, y b)


ランダムウォークの境界条件・偏微分方程式の数値計算

#6 : ( 8-13) URL : j inoue/index.html : Neugart


Informatics 2014

n 第1章 章立ての部分は、書式(PC入門大見出し)を使います

RX600 & RX200シリーズ アプリケーションノート RX用仮想EEPROM

Informatics 2010.key

スライド 1


0.6 A = ( 0 ),. () A. () x n+ = x n+ + x n (n ) {x n }, x, x., (x, x ) = (0, ) e, (x, x ) = (, 0) e, {x n }, T, e, e T A. (3) A n {x n }, (x, x ) = (,

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

x = a 1 f (a r, a + r) f(a) r a f f(a) 2 2. (a, b) 2 f (a, b) r f(a, b) r (a, b) f f(a, b)

1 1.1 C 2 1 double a[ ][ ]; 1 3x x3 ( ) malloc() malloc 2 #include <stdio.h> #include

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,

1 filename=mathformula tex 1 ax 2 + bx + c = 0, x = b ± b 2 4ac, (1.1) 2a x 1 + x 2 = b a, x 1x 2 = c a, (1.2) ax 2 + 2b x + c = 0, x = b ± b 2

,. Black-Scholes u t t, x c u 0 t, x x u t t, x c u t, x x u t t, x + σ x u t, x + rx ut, x rux, t 0 x x,,.,. Step 3, 7,,, Step 6., Step 4,. Step 5,,.

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

1 X X T T X (topology) T X (open set) (X, T ) (topological space) ( ) T1 T, X T T2 T T T3 T T ( ) ( ) T1 X T2 T3 1 X T = {, X} X (X, T ) indiscrete sp

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

all.dvi

num2.dvi

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

> > <., vs. > x 2 x y = ax 2 + bx + c y = 0 2 ax 2 + bx + c = 0 y = 0 x ( x ) y = ax 2 + bx + c D = b 2 4ac (1) D > 0 x (2) D = 0 x (3

高等学校学習指導要領

Transcription:

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) * y sol[] 6. 5. y y y2 7. Loop ( 9-1a.c ) 1.0x 2 2.0x + 0.0 = 0 [-10.0, 10.0] 0.001 1.0-2.0 0.0-10.0 10.0 0.001

A 9-1a.c 1/2 /* yamikumo method of solution for a quadratic equation */ #include <stdio.h> #include <math.h> #define hantei 0.001 int main(void) { double a, b, c; /* equation coefficients */ double area_a, area_b, step; /* searching area */ int i, j=0, kizami, nsol=0; double sol[2], soly[2]; /* there are two solutions */ double x, y1=1000.0, y2=1000.0; /* input equation coefficients and searching area */ printf("input floating number of a,b,c of ax^2 + bx + c =0 \n"); printf("by spaceing a b c\n"); scanf("%lf %lf %lf", &a, &b, &c); printf("given equation is %lf x^2 + %lf x + %lf = 0\n", a, b, c); \n"); step); printf("input floating point number of start point, end point and step printf("by space start end step\n"); scanf("%lf %lf %lf", &area_a, &area_b, &step); printf("search area is from %lf to %lf by step %lf\n", area_a, area_b,

A 9-1a.c 2/2 /* Loop number count from area_a to area_b by step */ kizami = round((area_b - area_a)/step); /* calculate y of starting point */ y2 = a * area_a * area_a + b * area_a + c; /* search! */ for (i=0; i<kizami; i++) { x = area_a + step * i; y1 = a * x * x + b * x + c; printf("i/end= %d/%d y1= %lf \t y2=%lf y1*y2= %lf \r", i, kizami, y1, y2, y1*y2); /* solution exists at y==0.0 or between +y - -y */ if ( (y1 * y2)<0.0 y1==0.0 ) { sol[j] = x; soly[j] = y1; printf("\nfind! sol[%d]= %lf soly[%d]=%lf \n", j, sol[j], j, soly[j]); j++; /* include solution number */ } y2 = y1; /* transfer to next cell */ } /* display solutions */ printf("\n\nthe solutions are %lf, %lf \t y=%lf, %lf\n", sol[0], sol[1], soly[0], soly[1]); } return (0);

A unix time time./9-1a real 0m25.673s user 0m0.150s sys 0m0.050s real user 9-1a CPU sys UNIX CPU CPU 0.150

B [1, 2] 1. 2. a, b 3. a, b f(a), f(b) 4. 50 (x) (dx) (xacc) f(x) a f(a ) 5.

B ( 9-1b.c ) 1.0x 2 2.0x + 0.0 = 0 [0.5, 100.0] 0.00001 1.0-2.0 0.0 0.5 100.0 0.00001 time 9-1b.c Excel

B 9-1b.c 1/2 /* nibun method of solution for a quadratic equation */ #include <stdio.h> #include <math.h> #define NMAX 50 double quadratic(double a, double b, double c, double x); int main(void) { double a, b, c; /* equation coefficients */ double area_a, area_b, xacc; /* searching area and x_accuracy */ int nloop; double x1, x2, x, dx; /* input equation coefficients and searching area */ printf("input floating number of a,b,c of ax^2 + bx + c =0 \n"); printf("by spaceing a b c\n"); scanf("%lf %lf %lf", &a, &b, &c); printf("given equation is %lf x^2 + %lf x + %lf = 0\n", a, b, c); printf("input floating point number of start point, end point and step \n"); printf("by space start end x accuracy\n"); scanf("%lf %lf %lf", &area_a, &area_b, &xacc); printf("search area is from %lf to %lf with solution accuracy %lf\n", area_a, area_b, xacc); /* check bad range f(area_a) x f(area_b) >0 */ if ( quadratic(a, b, c, area_a) * quadratic(a, b, c, area_b) >=0.0 ){ printf("illegal section [%g, %g]\n", area_a, area_b); return 1; }

B 9-1b.c 2/2 x1 = area_a; x2 = area_b; for (nloop=0; nloop<nmax; nloop++) { x = ( x1 + x2 )/2.0; dx = fabs(x2-x1); if (dx < xacc) { printf("answer: %g \n", x); return 0; } if ( quadratic(a, b, c, x1) * quadratic(a, b, c, x) < 0.0) { x2 = x; }else{ x1 = x; } } } printf(" can not find solution! \n"); return 1; double quadratic(double a, double b, double c, double x) { double y; } y = a * x * x + b * x + c; return y;

C x c x = a (b a) f (a) f (b) f (a) 9-1b.c 9-1c.c

! f(x) = -1 x<0 f(x) = +1 x 0 0 0-1 1 f(x) = x -1 0 f(x) x=0 f(x) f(x) = x 2 x=0 f(x)

Newton f(x) Newton x i

D f(x) = cos(x) -x -1.0 ~ 3.0

f(x) [a, b] N [ ] I = f (x)dx = f (x i ) Δx = Δx f (x 0 ) + f (x 1 ) + + f (x N ) a b i=1 [a, b] N h=(b-a)/n x 0 =a, x 1 =x 0 +h,, x N =b f(x)

f(x) N N [ ] I = f (x)dx = f (x i ) Δx = h f (x 0 ) + f (x 0 + Δx) + + f (x N ) a b i=1

f(x) N I = f (x)dx = a b N i=1 1 2 f (x ) + 1 i 2 f (x ) i+1 Δx = h 1 N 1 2 f (x ) + f (x ) 0 i + 1 2 f (x ) N i=1 f(x) f(x) I = f (x)dx = a b N i=1 1 3 f (x ) + 4 i 3 f (x ) + 1 i+1 3 f (x ) i+2 Δx Simpson

A 0.01 0.0 9.42 cos x 0.01 xy OpenOffice cos x sin x OpenOffice OpenOffice C cos xdx = sin x I = cos xdx = cos(x i ) 0.01 0 9.42 N i=1 ( 9-2a.c ) 9-2a 0.0 9.42 0.1 9-2a.txt

A 9-2a.c 1/2 /* kukei sekibun */ #include <stdio.h> #include <math.h> double xsin(double x); double integ_xsin(double x); int main(void){ double start_p, end_p, kizami; int i, max; double x, integ=0.0; /* set arb. const of integral to zero */ FILE *file1; /* file pointer, nessary to use file input/output */ /* FILE *file2 file pointer nessary to use file input/output */ file */ file1 = fopen("9-2a.txt","w"); /* open 9-2a.dat to write data*/ /* file2 = fopen("text data","r"); open test.data to read */ /* fscanf(file2,"%lf %lf %lf", &start_p, &end_p, &kizami); read data from printf("input start, end points and step by floating point number\n"); scanf("%lf %lf %lf", &start_p, &end_p, &kizami); printf("given integral section is [%lf, %lf] step %lf\n", start_p, end_p, kizami); max = round((end_p - start_p)/kizami); printf("x\tcos x\tnumeric integration\tsin x\n"); for (i=0; i<max; i++){ x = start_p + kizami * i ; integ += cos( x ) * kizami; printf("%lf\t%lf\t%lf\t%lf\n", x, cos(x), integ, sin(x) );

A 9-2a.c 2/2 /* output data to standard output*/ fprintf(file1,"%lf\t%lf\t%lf\t%lf\n", x, cos(x), integ, sin(x)); /* output data to file2 */ } } fclose(file1); /* close file1 */ /* fclose(file2); close file2 */ return 0; /* function ha Integral(x sin x dx) = sin x - x cos x */ double xsin(double x){ return (x*sin(x)); } /* sin x - x cos x */ double integ_xsin(double x){ return (sin(x)-x*cos(x)); }

B x sin xdx = sin x 0.1 0.0 9.42 sin x - x cos x x cos x I = cos xdx = 1 2 cos(a) + cos(x ) 0.1 i + 1 2 cos(b) 0 9.42 N 1 i= 2 OpenOffice OpenOffice C C

B [8, 9] 2 8 8.2 8.4 8.6 8.8 9 x h 3 Simpson h 5 h 5 Integral(x sin(x)) 9 8 7 6 5 4 3 Numerical integration of x sin(x)

f(x) [a, b] 0 f(x) U I xy [a, b] y=0 (x ) y=f(x) a x b, 0 y U (x, y) y f(x) P = I / [U (b-a)] (x, y) y f(x) I y f(x)

f(x) df (x) dx = lim Δx 0 f (x + Δx) f (x) Δx f(x) x Δx

A [a, b] N Δx=(b - a)/n [0.0, 9.24] 0.01 sin x xy OpenOffice sin x cos x OpenOffice OpenOffice C cos xdx = sin x d sin x dx dsin x dx = cos x = sin(x + Δx) sin(x) Δx 0.1 1.0 sin x