Numerical method to solve a non-linear ODE

166 Views Asked by At

I want to solve numerically the following non-linear ordinary differential equation: $$f''(x)=A(1+f'(x)^2)^{3/2}-\frac{f'(x)}{x}(1+f'(x)^2)$$ where $A$ is a constant and $x\in[0,R]$. The ODE is also subjected to the following boundary conditions: $$f'(0)=0$$ $$f(R)=0$$ My struggle is with what method should I adopt to approximate the solution due to its high non-linearity. Thanks in advance.

1

There are 1 best solutions below

0
On

So, I adopted a finite difference approximation with a Newton-Rapson scheme to solve the non-linear system and it worked just fine. The singularity at $x=0$ ended up not being a problem since my system of nonlinear equations was: $$ \left\{\begin{array}{lcr} f_2-f_1 = 0 \\ \frac{f_{i+1}-2f_{i}+f_{i-1}}{h^2} - \frac{\gamma}{C}\left(\frac{f_{i+1}^2 -2f_{i+1}f_{i-1}+f_{i-1}^2+4h^2}{4h^2}\right)^{3/2} + \frac{\left(f_{i+1}-f_{i-1}\right)\left(f_{i+1}^2 -2f_{i+1}f_{i-1}+f_{i-1}^2+4h^2\right)}{8h^4(i-1)}\quad\forall 2 \le i\le N-1\\ f_N=0 \end{array}\right. $$ Thank you all for the replies!