Mathematica에서 shooting method를 이용해서 비선형 미분방정식의 해를 구하자. 

\begin{align}f' &= \frac{1}{x} (1-a) f \\ a'&=- \frac{x}{2} f^2 (f^2-1) \end{align}

경계조건은 $f(0)=0$, $f(\infty)\to 0$, $a(0)=0$을 만족시켜야 한다. $x$가 증가하면 $f(x)$는 빠르게 $1$로 수렴하므로 오른쪽 경계조건은 $f(15)\to1$로 잡아도 충분하다. $x=0$에서의 apparent singularity를 Mathematica가 처리할 수 있도록 방정식을 변형시켜주어야 한다.

 

 

 

728x90
Posted by helloktk
,

In relaxation methods ODEs are replaced by approximate finite difference equations (FDEs) on a grid or mesh of points that spans the domain of interest.

 

알고리즘 및 사용 예제 관련문서들:

NumericalRecipiesInC/c17-3.pdf

NumericalRecipiesInC/c17-4.pdf

 

Numerical Recipes 에서 얻을 수 있는 필요한 코드들:

1) solvde() : main routine; 

2) bksub ()  : supplementary routine

3) pinvs ()  : supplementary routine

4) red ()  : supplementary routine

5) difeq ()  : user supplied  routine in which differential equations, boundary conditions, and their jacobians are defined. called by solvde().

 

주의점: 경계조건 설정에서 주의해야 한다;

728x90
Posted by helloktk
,