2nd order ODE numerical solution

  • I
  • Thread starter Pcmath
  • Start date
  • #1
9
0

Main Question or Discussion Point

I would like to solve the following differential equation, it seems easy but only given one initial value.

y''(x) = ln(ln(x))
y(5) = 0
Solve for y(10)

I know it can be directly integrated but cannot be expressed in terms of elementary functions.

Most numerical method involves expressing the ODE in terms of first order ODE, but it need to have to initial value of y and also y'.

Is it even possible to solve this, given only y(5) = 0?
 

Answers and Replies

  • #2
DoItForYourself
Hello,

As long as it says "solve for y(10)", you can integrate two times without using the initial values, so y=y(x,c1, c2).
In order to find c2, you will use x=5, y=y(5)=0. In order to express c1 as a function of y(10), you will use x=10, y=y(10).
 
  • #3
9
0
But the integrand cannot be integrated in terms of elementary functions.

Or maybe you show the steps? Any help will be appreciated?
 
  • #4
DoItForYourself
I didn't mean that you can solve it analytically (You must deal with ##\int \frac {dx} {lnx}## if you proceed and try to solve it with integration by parts)

However, as long as you have a 2nd order DE with y(5)=0, you can solve it (numerically) and get y as a function of x and y(10).

You can try to solve it numerically with FEM (Finite Element Method).
 
Last edited by a moderator:
  • #5
9
0
Sorry I don't seem to get it. Can you show me the steps? It does not need to be accurate.
 
  • #6
DoItForYourself
Sorry I don't seem to get it. Can you show me the steps? It does not need to be accurate.
If you don't know the finite element method, it is useless. Try to solve it analytically by parts and let the integrals with ##\frac {dx} {lnx}## in the solution or try to find them with wolfram alpha/with the help of a calculator.

I can show you how to start:

##\frac {dy} {dx} = \int ln(lnx) \, dx=\int (x)'ln(lnx)\, dx \Rightarrow \frac {dy} {dx} = [xln(lnx)]- \int x (ln(lnx))'\, dx \Rightarrow
\frac {dy} {dx} = [xln(lnx)]- \int x (\frac {\frac {1} {x}} {lnx})'\,dx=[xln(lnx)]-\int \frac {1} {lnx}\, dx + c_1##

Proceed to find y(x) this way (integration by parts) and show us your work please.

Finally, you will need the initial conditions and a calculator to get the values for the integrals ##\int \frac {dx} {lnx}##.
 
  • #7
9
0
I tried FEM method.

However, if I change ln(ln(x)) to a simple one that can be integrated easily, like x2, then I would get different answer if I use FEM (assuming the function cannot be integrated analytically) when compared to answer obtained by finding the function y(x) directly. What's the problem here?
 
  • #8
DoItForYourself
Maybe, you need to use more steps in order to get the exact solution/function.
 
  • #9
564
91
However, as long as you have a 2nd order DE with y(5)=0, you can solve it (numerically) and get y as a function of x and y(10).
You are still missing a boundary condition for the derivative. Some numerical methods will just assume y' at the starting point to be zero and start anyway.

By the way, a second order ode of the form y"(x)=f(x) can always be reduced to a first order ode by introducing the variable w=y', w'=y"
so you would have w'(x) = f(x)=log(log(x)), the solution is some exponential integral in your case.
You need a boundary condition for it though to completely solve it, or you will end up with an unknown integration constant. And this boundary condition is missing. As was said in post #2, you can still express y(10) in terms of the integration constant (or y'(5) )
 
  • #10
264
70
I propose, as suggested by bigfooted, to convert the equation to a system of to first-order differential equations. You can then use, e.g., Runge-Kutta method to solve the problem. However, for a unique solution you need a value for the derivative at some point. Alternatively, you can use Numerov's method to solve the 2nd order equation directly.
 

Related Threads for: 2nd order ODE numerical solution

  • Last Post
Replies
6
Views
3K
Replies
5
Views
3K
Replies
0
Views
1K
Replies
1
Views
2K
Replies
14
Views
1K
Replies
5
Views
3K
Replies
5
Views
2K
Replies
1
Views
2K
Top