runge-kutta방법을이용한상미 분방정식의풀이 · contents 1. what is the...
TRANSCRIPT
Runge-Kutta 방법을 이용한 상미분 방정식의 풀이
Contents
1. What is the Runge-Kutta Method?
2. Solutions of ODEs by using the Visual Basic for Applications
- Building User-defined functions in VBA
- Solutions using by the 2nd order RK- Solutions using by the 4th order RK
- Runge-Kutta 수학적 유도
ℎ+ ℎ2
( + ℎ2 , + 2 )= ℎ ∙ ( , )
, = , = ℎ ∙ ( , )
( + ℎ2 , + 2 )( + ℎ, + )
기울기 6개를 가지고평균을 내서 구함!
Runge-Kutta
2nd order
= + 1 − + ( ≠ 0)= ℎ ∙ ( , )= ℎ ∙ + , +Runge-Kutta
3rd order
= + 16 ( + 4 + )= ℎ ∙ ( , )= ℎ ∙ + , += ℎ ∙ + ℎ, − 2 + 2Runge-Kutta
4th order
= + 16 ( + 2 + 2 + )= ℎ ∙ ,= ℎ ∙ + , += ℎ ∙ + , += ℎ ∙ + ℎ, + , =
Solutions of ODEs by using the Visual Basic for Applications
- Building User-defined functions in VBA[Alt+F11] key를 눌러 VB 에디터를 호출
메뉴의 [삽입>모듈]로 모듈을 만든 후, 다음을 입력한다.
사용자함수이름
함수에 사용될 변수이름
데이터형식
함수 정의
변수가 2개 사용되서
- Solutions using by the 2nd order RK1. 셀 [h] 지정
2. [ =h*plusHap(C8, E8) ] 입력
3. [ =h*plusHap(C8+h/2, E8+F8/2) ] 입력
4. [ =E8+G8 ] 입력
5. [ =D8 ] 입력
자동 채우기로 , , 순으로 자동채움
1 23
4개의 셀을 같이 선택한 후 자동채움
- Solutions using by the 4th order RK1. 셀 [h] 지정
2. [ =h*plusHap(C8, E8) ]
3. [ =h*plusHap(C8+h/2, E8+F8/2) ]
4. [ =h*plusHap(C8+h/2, E8+G8/2) ]
5. [ =h*plusHap(C8+h, E8+H8) ]
6. [ =E8+(F8+2*G8+2*H8+I8)/6 ]
7. [ =D8 ]
-> 차수가 높아질수록 오차가 줄어듬!!
* 비교
Summary
1. Runge-Kutta법 : - 도함수의 평균값으로 수치해석- 차수가 높을수록 정밀
2. 비쥬얼베이직에디터 호출방법 : [Alt+F11] key
3. 모듈 작성하는 방법 : [메뉴>삽입>모듈]