• 검색 결과가 없습니다.

운동시뮬레이션 제 제1 1주 주

N/A
N/A
Protected

Academic year: 2022

Share "운동시뮬레이션 제 제1 1주 주"

Copied!
23
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

운동시뮬레이션

운동시뮬레이션 제 제1 1주 주

강의 소개, A First Numerical Problem 컴퓨터응용과학부 2011년 봄학기 담당교수 : 이형원 E304호, hwlee@inje.ac.kr E304호, hwlee@inje.ac.kr

(2)

강의소개 강의소개

 담당교수 : 컴퓨터응용과학부 이형원

 교재 : Computational Physics, N.J.

Giordano, H. Nakanishi, Prentice Hall

강의시간 : 수8교시, 목6,7교시

 강의시간 : 수8교시, 목6,7교시

 평가방법

네 번의 필기 시험 : 총 60%

 1,3차 시험 : 각 10%

 중간, 기말고사 : 각 20%

두 번의 실기 시험 : 총 30%

출석 : 총 10%

(3)

선수지식 선수지식(Prerequisites (Prerequisites))

 미분방정식(Differential Equations)

 수치해석(Numerical Analysis)

 프로그램언어(Program Language)

One of Java, C#, C, C++, Fortran,

One of Java, C#, C, C++, Fortran, Basic, Ada

 일반물리(General Physics)

(4)

참고자료 참고자료(References) (References)

 General Physics

 Java

 C#

 C, C++

 C, C++

 Numerical Analysis

 Differential Equations

(5)

강의자료 강의자료

 http://socas.inje.ac.kr -> 자료실 ->

일반자료실

(6)

진행

진행 계획 계획

 제1주 : 강의소개, A First Numerical Problem(3 월 2일 수업, 3월 3일 실습)

 제2주 : Realistic Projectile Motion(3월 9일 수업, 3월 12일 실습)

 제3주 : Oscillatory Motion and Chaos(3월 16일 수업, 3월 17일 실습)

수업, 3월 17일 실습)

 제4주 : 1차 필기 시험(3월 23일)

 제5주 : The Solar System(3월 30일 수업, 3월 31일 실습)

 제6주 : Potentials and Fields(4월2일 수업, 실습)

 제7주 : Waves(4월 6일 수업, 4월 7일 실습)

 제8주 : 중간 필기 및 실기 시험(4월 20일 필기, 4월 21일 실기)

(7)

진행계획 진행계획((계속 계속))

 제9주 : Random Systems(4월 27일 수업, 4월 28일 실습)

 제10주 : Statistical Mechanics, Phase Transition, and Ising Model(5월 4일 수업, 5월 7일 실습)

 제11주 : Molecular Dynamics(5월 11일 수업, 5월 12일 실습)

12일 실습)

 제12주 : 3차 필기 시험(5월 18일)

 제13주 : Quantum Mechanics(5월 25일 수업, 5월 26일 실습)

 제14주 : Vibrations, Waves, and the Physics of Musical Instruments(5월 28일 수업, 6월 2일 실습)

 제15주 : Interdisciplinary Topics(6월 8일 수업, 6월 9일 실습)

 제16주 : 기말필기 및 실기 시험(6월 15일 필기, 6월 16일 실기)

(8)

Chapter

Chapter 1 A first numerical 1 A first numerical problem

problem

 Radioactive decay

 A Numerical approach

 Design and construction of a working program: codes and working program: codes and pseudocodes

 Testing your program

 Numerical considerations

 Programming guidelines and philosophy

(9)

Radioactive Decay Radioactive Decay

n Ba

Kr U

U

n 235 236 92 +141 +3

(10)

Differential equation for Differential equation for nuclear decay

nuclear decay

 Number of particles will change as decay process

τ

U

U N

dt

dN =

 Solution for the equation

τ

dt =

/τ

) 0 ( )

( U t

U t N e

N =

(11)

How to solve diff. equation How to solve diff. equation

 Change the equation as

τ

dt N

dN

U

U =

 Integrate both side as

τ τ

t N

t N

dt N

dN

U t U

t N N

U

U U

U

=

=

(0)

) ln (

0 )

( ) 0 (

(12)

Graph of the solution Graph of the solution

) 0

U( N

t

(13)

Numerical approach Numerical approach

 Use Taylor’s expansion

+L

+

+

=

= =

2 0

2 2

0 2

) 1 0 ( )

( t

dt N t d

dt N dN

t N

t U t

U U

U

 Ignore the second order

=0 t=0

t

t dt

N dN t

N

t U U

U +

=0

) 0 ( )

(

(14)

Numerical approach Numerical approach

 Graphical interpretation

) ( t N

) ( t NU

)

( exact

U t

N

t

(15)

Numerical approach Numerical approach

 Definition of derivative

t

t N

t t

N t

t N

t t

N dt

dN U U U U

t U

+

+

) ( )

( )

( )

lim (

0

 Gives(Euler method)

t t

dt

t dt

t dN N

t t

N

t t U U

U + +

=

) ( )

(

(16)

Numerical approach Numerical approach

 Inserting the decay equation

t t t N

N t

t

N U

U

U +

τ

) ) (

( )

(

 We can obtain values(initial value problem)

τ

)L 3

( )

2 ( )

( )

0

( N t N t N t

NU U U U

(17)

Design Program Design Program

 Declare necessary variables

 Initialize variables

 Do the actual calculation

 Store the result/Show result as

 Store the result/Show result as graph

(18)

Pseudo code for Pseudo code for initialization

initialization

 Get data from console

 Set initial time, final time, time step

 Set initial nucleus number, decay time

time

(19)

Pseudo code for calculation Pseudo code for calculation

 For each time step I, calculate and t at step i+1

NU

t t

N t

N t

NU ( i+1) = U ( i)( U( i)/τ) t

t

ti+1 = i +

Repeats for n-1 time steps

t t

ti+1 = i +

(20)

Testing your program Testing your program

 Does the output look reasonable?

 Does your program agree with any exact results that are available?

 Always check that your program

 Always check that your program

gives the same answer for different

“step sizes”

(21)

Numerical considerations Numerical considerations

 Round-off error exist: use double precision

 Total error(global error) exist

 For unknown exact solution, check

 For unknown exact solution, check if converge the result with step size

(22)

Programming guidelines Programming guidelines

 Program structure

Organize the program readable and understandable

 Use descriptive names

 Use descriptive names

Choose variable and function names meaniful words

 Use comment statements

(23)

Programming guidelines Programming guidelines

 Sacrifice(almost) everything for clarity

Use more variables if it is descriptive

Change algorithm for execution speed

Change algorithm for execution speed

 Take time to make graphical output as clear as possible

참조

관련 문서

„ Process rank (in range 0, 1, …, p-1) returned through second argument.

Penalty Function Method, Sequential Linear Programming, Constrained Steepest Descent Method, Method of Feasible Directions(MFD), Sequential Quadratic Programming(SQP), etc.

- 이 class에서 가시화를 담당하는 함수는 RenderScene() 함수이다. 이를 위해 OpenGLVeiw class에서는.. 이를 위해서는 CColorDialog class를 이용해야

Bspline classs ... BsplineSurface classs ... CASDMFCDoc class ... OpenGLVeiw class .... 따라서 curve와는 달리, surface는 Cox-de Boor recurrence formula를 적용핛

Calculator 클래스를 사용하기 위해서는 패키지를 포함 하는 정확한 경로명을 컴파일러에게

Read the error step using a peripheral device and check and correct contents of the dedicated instruction for special function modules of

auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void.. default

Venus Earth Mars Jupiter Saturn Uranus Neptune