Solving an ODE using shooting method

Click For Summary

Discussion Overview

The discussion revolves around solving a boundary value problem (BVP) represented by a second-order ordinary differential equation (ODE) using the shooting method. Participants explore the derivation of a Taylor expansion to handle a singularity at the boundary condition.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents the ODE and boundary conditions, outlining the conversion to a set of coupled ODEs for the shooting method.
  • Another participant suggests using the original differential equation to derive the Taylor series expansion, but expresses confusion over the numerical factors involved.
  • A different participant proposes a method to represent the function y as a polynomial for small values, leading to a different expression for the Taylor expansion, which includes a factor of 1/8.
  • A later reply acknowledges reaching a similar conclusion but uses a different variable in their calculations, indicating discrepancies in the numerical factors derived.
  • One participant requests assistance with unexpected results from their code implementation related to the ODE solution.

Areas of Agreement / Disagreement

Participants express differing views on the derivation of the Taylor expansion, particularly regarding the numerical factors involved. There is no consensus on the correct factor, and the discussion remains unresolved.

Contextual Notes

Participants have not fully clarified the assumptions behind their calculations, and there are unresolved discrepancies in the numerical factors derived from the Taylor expansion.

spaghetti3451
Messages
1,311
Reaction score
31
Hi, I am trying to solve the following ODE for my maths project:

## y'' = \frac{\alpha}{2}y^3 - \frac{3}{2}y^2 + y - \frac{3}{x} y'##

under the following boundary conditions:

## y'(0) = 0 ##
## y(x) \rightarrow y \_ \equiv 0\ \text{as}\ x \rightarrow \infty ##
As a first step, I converted this problem into a set of coupled ODEs:

## \frac{dy}{dx} = z##
## \frac{dz}{dx} = \frac{\alpha}{2}y^3 - \frac{3}{2}y^2 + y - \frac{3}{x} z##

under the following boundary conditions:

## z(0) = 0 ##
## y(x) \rightarrow y \_ \equiv 0\ \text{as}\ x \rightarrow \infty ##Next, my source tells me to use the shooting method to convert the BVP into an IVP, which means that I have to use two initial guesses of ## y(0) ## to be able to use the secant method to find the correct value of ## y(0) ##.

Now, my question is, according to my source, I can avoid the singularity at x = 0 using Taylor expansion as follows:

## y(r_{0}) = y_{0} + \frac{1}{16} r_{0}^{2} (2y_{0} - 3y_{0}^{2} + \alpha y_{0}^{3}) ##

I see how you can estimate ## y(r_{0}) ## where ## r_{0} ## is a tiny distance away from the origin, but I don't really see how they dervied this expression. Could anyone help me out?
 
Physics news on Phys.org
Just set y(0)'=0 and y(0)=y_0 in the original DE.
Then use this as your second derivative in your taylor series.

EDIT: Tried it myself, something weird is going on. The numerical factors come out different for me.
Maybe an error? I don't see where the factor of 1/16 comes from. It comes out as 1/4 for me.
 

Attachments

  • IMG_0319.JPG
    IMG_0319.JPG
    27.5 KB · Views: 554
Last edited:
Start out by representing y as a function of x at small values of y by y(x) = y(0)+bx2. Then

y' = 2bx
y''=2b

3y'/x = 6b

So ##8b=\frac{\alpha}{2}y(0)^3-\frac{3}{2}y(0)^2+y(0)##

So, ##y(r_0)=y(0)+br_0^2=y(0)+\frac{1}{8}r_0^2(\frac{\alpha}{2}y(0)^3-\frac{3}{2}y(0)^2+y(0))##

Chet
 
  • Like
Likes   Reactions: spaghetti3451
Thanks for the solution. I also came to the conclusion, but I used ## \frac{y''(0)}{2} ## in place of ## b ##. I have written the code that solves the ODE in my original post, but it's giving me unexpected results. I was wondering if anyone in Physics Forums might want to have a look at it.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
931
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K