Imposing normalization in numerical solution of of ODE

In summary: The first interior condition is the normalization condition. This means that the solution has to satisfy \int_{-\infty}^{\infty} y(x) dx=1
  • #1
jorgdv
29
0
Hello all,

I would like to know how to impose a normalization condition to numerically solving an ODE. For simplicity let's consider the example
[tex] \frac{dy}{dx}=y [/tex]
You could use different methods using an initial value, but if you consider the interval [tex][x_0,x_1][/tex] and [tex] \int_{x_0}^{x_1} y(x)dx=1 [/tex] How would you impose that condition in a numerical scheme (instead of the initial value condition)?
This arises in the context of PDEs over PDFs, such as Fokker-Planck equations. I consider the ODE case for simplicity.

Thank you very much
 
Physics news on Phys.org
  • #2
It must be a diabolical coincidence but in this very example the integral condition is equivalent to [itex]y(x_1)-y(x_0)=1[/itex]

But,well i don't know a generic method to impose such conditions into the numerical solution process.
 
  • #3
It depends on the problem. In general you can introduce a tunable parameter, and then iterate on the parameter unit the integral constraint is satisfied.

This particular ODE is invariant under the change of variables [itex] y = \alpha y^* [/itex]. However, the constraint is not invariant: [itex] \int y dx = \int \alpha y^* dx = 1 [/itex]. This allows us to solve for [itex] \alpha[/itex] using [itex] \alpha= 1 / \int y^* dx[/itex].

Solving this problem then takes three steps. First, solve the ODE [itex] y^* = \frac{dy^*}{dx}[/itex] for some guess initial condition. Use something simple like [itex] y^*\left(x_0\right) = 1[/itex].

Second, integrate [itex]\int y^* dx [/itex] to find [itex] \alpha[/itex].

Finally, use [itex] y = \alpha y^* [/itex] to find [itex] y [/itex].
 
  • #4
If you solve in Fourier space you will only have to make sure that your zero component of the transformed data is preserved in your numerical scheme.
 
  • #5
Thank you all for your responses. The analytic approach of invariant equations under change of variables is very interesting, and would work in this case, however I am looking for more generic approaches (if they exist). And about preserving your zero component in Fourier space, wouldn't it only preserve an additive constant in the solution?

The thing is that this solution would be a stationary solution of a PDE, say for example
[tex]\frac{\partial y}{\partial t}=\frac{\partial f(x)y(x)}{\partial x} -K\frac{\partial ^2 y(x)}{\partial x^2} [/tex]
Then the stationary solution would be something like the example I posted for [itex]f(x)=1[/itex] applying the condition [itex]lim_{x \to \infty}y(x)=0[/itex], so if it was not stationary you normally could use a Finite Elements or Finite Differences scheme, so a question would also be: how would you implement the normalization condition in the FE and FD approach to preserve the normalization across time?

Thank you all
 
  • #6
Well the I did assume that the inteterval in the first post was the boundary of your system. Perhaps that was not the case?
## lim_{x\rightarrow \infty} y(x) = 0 ## probably isn't the easiest boundary condition to implent in a finite simulation. Have you considered transforming x such that infinity is moved to a finite value?
 
  • #7
Sorry, it was not the case, maybe I did not explain myself well. There's no boundary to the system. In fact the normalization condition would be [itex]\int_{-\infty}^{\infty} y(x) dx=1[/itex], but for purpose of computation it could be aproximated with [itex]\int_{x_0}^{x_1} y(x) dx[/itex] with an interval that's big enough, that's why the condition [itex]\lim_{|x| \to \infty} y(x)=0[/itex] (yes, there's also the simetric limit condition) helps, since you could find better approximations by widening the interval.

But that conditions comes to place mainly when reducing the previous equation to a stationary sistem in the way
[tex] 0=\frac{\partial}{\partial x} (f(x)y(x)) -K \frac{\partial ^2 y(x)}{\partial x^2}[/tex]
Solving the first derivative means
[tex]f(x)y(x)-K\frac{\partial y(x)}{\partial x}=A[/tex]
But since that should be valid for all x, then [itex]A[/itex] should be 0 to satisfy the limit condition, and we are left with a similar system to the first I posted.
But that is only to give a context, I am intereseted in the question of implementing the approximated normalization condition in a numerical scheme.

Thanks
 
  • #8
First, as a general comment. The study of differential equations is a huge field. There is no general approach that allows one to solve all differential equations. Likewise there are no generic approaches that allow you to treat the integral constraint for all differential equations.

jorgdv said:
how would you implement the normalization condition in the FE and FD approach to preserve the normalization across time?

I'm not sure that I'm following you. But this is not a well-posed problem. If you give me an initial condition and two boundary conditions then you've completely specified the PDE. By then requiring that the integral over the domain has to be equal to unity, you are over-constraining the problem. There is no guarantee that a solution exists.

jorgdv said:
I am looking for more generic approaches

My statement "you can introduce a tunable parameter, and then iterate on the parameter unit the integral constraint is satisfied" is a very general approach. I then showed you how to use it with the ODE that you supplied.

In general consider a 2nd order ODE with 1 boundary condition and 1 integral condition. I can solve this by using the supplied boundary condition, and and guessing the second boundary condition. For instances I could suppose that the second boundary condition is [itex] y(x_2)=\alpha[/itex]. Then the trick is to iteratively adjust [itex] \alpha [/itex] until the integral constrain is satisfied.

Another approach is to reformulate the differential equation into a minimization problem (this works particular well for finite element methods). You can then use a penalty methods. The idea is to introduce a penalty function of the form [itex] c \left(\int y dx -1\right) [/itex] where [itex]c [/itex] is a large positive parameter. Since [itex]c [/itex] is large, the minimization will converge on a solution that approximately enforces [itex] \left(\int y dx -1\right) = 0 [/itex].
 
  • #9
Okay, thank you!
 

Related to Imposing normalization in numerical solution of of ODE

What is imposing normalization in numerical solution of ODE?

Imposing normalization in numerical solution of ODE refers to the process of scaling the solution of an ordinary differential equation (ODE) to a specific range, typically between 0 and 1. This is done to improve the accuracy and numerical stability of the solution.

Why is imposing normalization important in solving ODEs?

Imposing normalization is important because it helps to avoid numerical errors and improves the accuracy of the solution. It also ensures that the solution remains within a manageable range, making it easier to analyze and interpret.

How is imposing normalization achieved in numerical solution of ODEs?

There are several methods for imposing normalization in numerical solution of ODEs, including rescaling the initial conditions, using dimensionless variables, and applying a scaling factor to the ODE itself. The appropriate method will depend on the specific ODE and its initial conditions.

What are the potential drawbacks of imposing normalization in ODE solutions?

One potential drawback of imposing normalization is that it can lead to loss of information and precision in the solution. This is especially true if the scaling factor is too large or if the ODE has a highly nonlinear behavior. Additionally, imposing normalization may make it more difficult to interpret and compare the results with other methods or experiments.

Can imposing normalization be applied to all types of ODEs?

Yes, imposing normalization can be applied to most types of ODEs. However, the effectiveness and appropriate method may vary depending on the specific ODE and its initial conditions. It is important to carefully consider the implications and potential drawbacks before applying normalization to an ODE solution.

Similar threads

  • Differential Equations
Replies
3
Views
1K
  • Differential Equations
Replies
9
Views
2K
Replies
61
Views
909
  • Differential Equations
Replies
1
Views
5K
  • Differential Equations
Replies
3
Views
2K
Replies
2
Views
4K
Replies
10
Views
2K
  • Classical Physics
Replies
0
Views
180
Replies
5
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
Back
Top