What issues can arise when solving ODEs numerically?

  • Context: MHB 
  • Thread starter Thread starter Theia
  • Start date Start date
  • Tags Tags
    Ode
Click For Summary

Discussion Overview

The discussion revolves around the numerical analysis of the ordinary differential equation (ODE) $$y' = \frac{x^2}{1 + y\sin (y^2)}$$ with the initial condition $$y(0) = 0$$. Participants explore the implications of finding multiple solutions for specific values of $$x$$ and the continuity of the solution $$y(x)$$ in the context of numerical methods.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes that for $$x = 1.5$$, the solution $$y$$ can be computed without issues, yielding approximately $$0.941265$$, while for $$x = 2.5$$, there are three possible solutions: $$4.553574$$, $$4.892841$$, and $$5.084485$$.
  • Another participant raises concerns about the continuity of the function $$y(x)$$, questioning whether the existence of multiple solutions indicates that $$y(x)$$ is not a continuous function, which could affect the validity of numerical methods.
  • A participant suggests that the original ODE has critical points where the derivative $$y'$$ is not defined, which may complicate the numerical solution.
  • One participant expresses frustration over the focus on exact solutions, emphasizing their interest in understanding numerical methods and the behavior of solutions in cases where multiple values exist for a given $$x$$.
  • Another participant confirms that the existence of multiple values for $$y$$ at the same $$x$$ indicates that the solution is not a function of $$x$$, which complicates the use of numerical methods.

Areas of Agreement / Disagreement

Participants express differing views on the implications of multiple solutions for the continuity of $$y(x)$$ and the applicability of numerical methods. There is no consensus on whether the presence of critical points fundamentally undermines the ability to compute a numerical solution.

Contextual Notes

Participants mention critical points and the behavior of the ODE where the derivative is not defined, suggesting that these factors may limit the effectiveness of numerical methods. However, the specific implications of these issues remain unresolved.

Theia
Messages
121
Reaction score
1
Hi
I am trying to understand numerical analysis on my freetime and today I studyed how to solve $$y' = \frac{x^2}{1 + y\sin (y^2)}$$, with initial value $$y(0) = 0$$. I asked myself two simple questions: What is $$y(1.5)$$ and what is $$y(2.5)$$?

As for to check the answers, I solved the ODE. In implicit form one can write $$2x^3 - 3 = 6y - 3\cos (y^2)$$. Now, when $$x = 1.5$$, one can solve the $$y \approx 0.941265$$ with no problems. However, when $$x = 2.5$$, there are three solutions for $$y$$, namely $$4.553574\ ;\ 4.892841\ ;\ 5.084485$$. :confused:

One knows that denominator of the ODE has two roots (in the range I'm now interested): $$1.92073\ ;\ 2.420171$$ that will ruin something. But my question for you is, what these roots will ruin? Is the solution $$y(x)$$ a continuous function even though the derivative of it exists? Because... If the $$y(x)$$ is not continuous, then I could compute for example sheeps and cows with what ever method to obtain silly answers. If the function is continuous then one just needs to find a suitable method to obtain numbers. Any thoughts? Thank you!
 
Physics news on Phys.org
Theia said:
Hi
I am trying to understand numerical analysis on my freetime and today I studyed how to solve $$y' = \frac{x^2}{1 + y\sin (y^2)}$$, with initial value $$y(0) = 0$$. I asked myself two simple questions: What is $$y(1.5)$$ and what is $$y(2.5)$$?

As for to check the answers, I solved the ODE. In implicit form one can write $$2x^3 - 3 = 6y - 3\cos (y^2)$$. Now, when $$x = 1.5$$, one can solve the $$y \approx 0.941265$$ with no problems. However, when $$x = 2.5$$, there are three solutions for $$y$$, namely $$4.553574\ ;\ 4.892841\ ;\ 5.084485$$. :confused:

One knows that denominator of the ODE has two roots (in the range I'm now interested): $$1.92073\ ;\ 2.420171$$ that will ruin something. But my question for you is, what these roots will ruin? Is the solution $$y(x)$$ a continuous function even though the derivative of it exists? Because... If the $$y(x)$$ is not continuous, then I could compute for example sheeps and cows with what ever method to obtain silly answers. If the function is continuous then one just needs to find a suitable method to obtain numbers. Any thoughts? Thank you!

Why solve it numerically when it can be solved exactly through separation of variables?

$\displaystyle \begin{align*} \frac{\mathrm{d}y}{\mathrm{d}x} &= \frac{x^2}{1 + y\sin{ \left( y^2 \right) } } \\ \left[ 1 + y\sin{ \left( y^2 \right) } \right]\,\frac{\mathrm{d}y}{\mathrm{d}x} &= x^2 \\ \int{ \left[ 1 + y\sin{ \left( y^2 \right) } \right] \,\frac{\mathrm{d}y}{\mathrm{d}x} \,\mathrm{d}x} &= \int{ x^2\,\mathrm{d}x} \\ \int{ \left[ 1 + y\sin{ \left( y^2 \right) } \right] \, \mathrm{d}y } &= \frac{1}{3}\,x^3 + C_1 \\ y + \frac{1}{2} \int{ 2\,y\sin{ \left( y^2 \right) } \,\mathrm{d}y } &= \frac{1}{3}\,x^3 + C_1 \\ y + \frac{1}{2} \int{ \sin{ \left( u \right) } \,\mathrm{d}u } &= \frac{1}{3}\,x^3 + C_1 \textrm{ after substituting } u = y^2 \implies \mathrm{d}u = 2\,y\,\mathrm{d}y \\ y + \frac{1}{2}\,\left[ -\cos{\left( u \right) } \right] + C_2 &= \frac{1}{3}\,x^3 + C_1 \\ y - \frac{1}{2}\cos{ \left( y^2 \right) } + C_2 &= \frac{1}{3}\,x^3 + C_1 \\ 6\,y - 3\cos{ \left( y^2 \right) } &= 2\,x^3 + C \textrm{ where } C = 6\,\left( C_1 - C_2 \right) \end{align*}$

Now with the initial condition $\displaystyle \begin{align*} y\,\left( 0 \right) = 0 \end{align*}$ we have

$\displaystyle \begin{align*} 6\,\left( 0 \right) - 3 \cos{ \left( 0^2 \right) } &= 2\,\left( 0 \right) ^3 + C \\ -3 &= C \end{align*}$

Thus the solution is $\displaystyle \begin{align*} 6\, y - 3\cos{ \left( y^2 \right) } = 2\,x^3 - 3 \end{align*}$.
 
Prove It said:
Why solve it numerically when it can be solved exactly through separation of variables?

The answer to this question is in the beginning of my first post: "I am trying to understand numerical analysis".

In addition, the solution you derived, was also mentioned in my post; thank you for verifying it. So yes, I know the implicit solution exists and I use it determine how well I can compute the numerical value.

But again, my main question was, is the solution $$y(x)$$ continuous function in the sense that a numerical method can be used? As you can see from the implicit solution, there are three different values $$y(x)$$ can get at that point. With one initial value I can compute just one value for $$y(x)$$, not three, and this is the reason I'm posting this thread. I want to understand what is happening when I compute the numerical solution in this case.

(Clearly, I should have chosen the ODE such that no one can solve it analytically to avoid exact functions completely, but this would have make it unnecessarily difficult to compare different solutions. I'm sorry, I didn't notice the rules of the forum saying anything about 'use only exact functions in the forum content, don't be interested in numerics' or 'make sure to explain why you wish to understand a certain area in mathematics better'. I must admit, I'm a bit disappointed...)
 
Hi Theia! Welcome to MHB! (Smile)

The solution is not a function of x. That's why we have multiple values for the same x.
More specifically, even the exact solution that we found is not an actual solution.
That is because the original ODE (y') is not defined everywhere on the curve.

To investigate the behavior, we should look at the values where y' is not defined, or alternatively where we have critical points.
 
Thank you, I like Serena.

Hmm... So because there are points where the derivative $$y'$$ is not defined, implies that numerical solution won't work because it tries to use values that don't necessarily exist. Cool!
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
1
Views
2K