Can Numerical Methods Solve an ODE Without Initial Conditions?

In summary, the given differential equation can be solved using numerical methods such as Euler or Runge Kutta, even without initial conditions. The analytical solution can also be obtained using the Lambert's W function. However, in order to use the numerical method, an arbitrary initial condition needs to be stated and this will lead to a solution that can be translated to obtain all other solutions. The case of y=0 is a limit case and is never reached.
  • #1
Inigma
4
0
I have to solve this ODE with numerical methods:
[itex](y^2 - 1)\frac{dy}{dx}=3y[/itex]

I have no initial conditions to solve it like you would normally do. I am hoping to use a numerical method (Euler... Runge Kutta) to approximate the solution. This is if I solve it using numerical methods right? So, I got to the following solution for x, by integrating both sides:
[itex]x=\frac{1}{6}y^2 + \frac{1}{3}lny + c[/itex] where c is the constant after integrating. With c in the way and no initial conditions, how do I then get to go ahead? am I approaching this the wrong way? your help would be greatly appreciated... thanks!
 
Last edited:
Physics news on Phys.org
  • #2
Inigma said:
I have to solve this ODE with numerical methods:
[itex](y^2 - 1)\frac{dy}{dx}=3y[/itex]

I have no initial conditions to solve it like you would normally do. I am hoping to use a numerical method (Euler... Runge Kutta) to approximate the solution. This is if I solve it using numerical methods right? So, I got to the following solution for x, by integrating both sides:
[itex]x=\frac{1}{6}y + 3lny + c[/itex] where c is the constant after integrating. With c in the way and no initial conditions, how do I then get to go ahead? am I approaching this the wrong way? your help would be greatly appreciated... thanks!

Hi !

There is a small mistake in your equation : The coefficient of lny should be 1/3 instead of 3.
The analytical solving is possible, thanks to the Lambert's W function (in attachment).
For numerical solving, you can state an arbitrary initial condition and use any numerical method. This will permit to draw a first curve y(x).
All other curves, corresponding to different values of c, are just translated from the first curve. In fact, giving an initial condition is equivalent to give the translation value. This is because the ODE contains only y and y' but no x.
 

Attachments

  • Lambert EDO.JPG
    Lambert EDO.JPG
    24.4 KB · Views: 527
  • #3
Actually, unless I am missing something obvious, the correct solution for this equation is:

[tex]x=\frac{y^2}{6}-\frac{lny}{3}+c[/tex]

In order to come to this formulation, however, you have to assume that y cannot be zero.

Also, if you already have the analytical solution, then you no longer need the numerical method, unless of course you explicitly want to solve the equation numerically.
 
  • #4
meldraft said:
Actually, unless I am missing something obvious, the correct solution for this equation is:

[tex]x=\frac{y^2}{6}-\frac{lny}{3}+c[/tex]

In order to come to this formulation, however, you have to assume that y cannot be zero.

Also, if you already have the analytical solution, then you no longer need the numerical method, unless of course you explicitly want to solve the equation numerically.

From the explicit solution given in my preceeding post, the case y=0 doesn't exist.
We can see that if x tends to infinity, exp(-6x) tends to 0, then W(0) tends to 0 and y tends to 0. But tending to 0 doesn't mean equal 0. So, y=0 is a limit case in fact, never reached, in so far as x is finit.
 
  • #5
meldraft: Your answer is correct and I wish to continue beyond the solution you stated. In this case by using a numerical method to plot the appromimate solution.

JJacquelin: Thank you, and I have found a lot of sense from wha you told me. I have also plotted the curves and have a rough idea what to expect in terms of convergence and infinities. I just struggle with the (my preferred method due to higher accuracy) the Runge Kutta method, since there is no x in the differential. I do not know what to do with say [itex]k1=f(x0,y0)=\frac{3y}{y^2 -1}[/itex] would this method work when there is no x in the differential? I guess not...
 
  • #6
You can state x0 any value you want. As I already say, you will obtain one first solution i.e. one first curve y(x). All the other solutions are translated from the first one. Alltogether, the result is globally the same : it doesn't mater which is the first solution to start with.
 

1. What are the different numerical methods available for solving ODEs?

There are several numerical methods that can be used to solve ODEs, such as Euler's method, Runge-Kutta method, and Adams-Bashforth method. Each method has its own advantages and disadvantages, and the choice of method depends on the specific problem at hand.

2. How do I choose the appropriate step size for solving an ODE numerically?

The step size for solving an ODE numerically should be chosen carefully to balance accuracy and computational efficiency. Generally, a smaller step size results in a more accurate solution, but it also requires more computational time. A good approach is to start with a larger step size and gradually decrease it until the desired accuracy is achieved.

3. Can I use any programming language to implement numerical methods for solving ODEs?

Yes, there are many programming languages that can be used to implement numerical methods for solving ODEs, such as MATLAB, Python, and C++. The choice of language depends on personal preference and the availability of relevant libraries and tools.

4. How do I know if my numerical solution to an ODE is accurate?

One way to check the accuracy of a numerical solution to an ODE is to compare it with an analytical solution, if available. Another approach is to vary the step size and check if the solution changes significantly. Additionally, there are error estimation methods that can be used to quantify the error in a numerical solution.

5. Can I use numerical methods to solve any type of ODE?

Numerical methods can be used to solve a wide range of ODEs, including initial value problems, boundary value problems, and systems of ODEs. However, the complexity of the problem and the choice of method may vary depending on the type of ODE being solved.

Similar threads

Replies
7
Views
2K
  • Differential Equations
Replies
3
Views
368
  • Differential Equations
Replies
3
Views
1K
  • Differential Equations
Replies
5
Views
2K
  • Differential Equations
Replies
9
Views
2K
  • Differential Equations
Replies
1
Views
1K
Replies
24
Views
3K
  • Differential Equations
Replies
3
Views
1K
  • Differential Equations
Replies
2
Views
2K
Replies
5
Views
1K
Back
Top