Numerically calculating the solution for a non-homogeneous ODE system

In summary, the conversation discussed the use of the Crank-Nicolson method for solving systems of homogeneous ODEs and the limitations of this method for solving non-homogeneous ODEs. The equations for a specific system of non-homogeneous ODEs were also provided, along with the suggestion of using the trapezium rule method or the Laplace transform for analytical solutions. The use of Runge-Kutta methods was also mentioned as a potential alternative for solving ODEs with a similar level of difficulty.
  • #1
semc
368
5
I have been solving system of homogeneous ODE numerically using Crank-nicolson (CN) method but now I have a system of non-homogeneous ODE. It would seem that CN would not work since the rank of the matrix will be less than the dimension of the matrix. Is there any other method that can numerically calculate a system of non-homogeneous ODE?
 
Physics news on Phys.org
  • #2
What are the equations?
 
  • Like
Likes jim mcnamara
  • #3
It is like

[tex]\dot{x_1}=x_1-x_2+x_3+a [/tex]
[tex]\dot{x_2}=x_1+2x_2+x_3 +b[/tex]
[tex]\dot{x_3}=-x_1+x_2+x_3+c [/tex]

where a,b and c are constants w.r.t. time
 
  • #4
The Crank-Nicolson scheme is for PDE's, specifically for diffusion equations. How do you use it in a system of ODE's? If you just average x1,x2 and x3 over the current and next time step, you are actually applying the trapezium rule method. Anyway, if the nonhomogeneous terms are constants, they will simply appear on the diagonal of your discretization matrix.
 
  • #5
Yes I just realized that it is called the trapezium method. I do not understand why they are on the diagonal. Using the case that I provided, how should I construct the matrix?
 
  • #6
I may be wrong here, but I'm pretty sure this system can be solved analytically with Laplace transforms. If that's not what you're after, the trapezoidal rule should work too.
 
  • #7
Have you tried runge-kutta methods? I've been using it to solve some classical gravitational dynamics which have this level of difficult.
 

Related to Numerically calculating the solution for a non-homogeneous ODE system

1. How do you numerically calculate the solution for a non-homogeneous ODE system?

The most common method for numerically solving a non-homogeneous ODE system is by using numerical integration techniques, such as Euler's method or the fourth-order Runge-Kutta method. These methods involve breaking down the system into smaller, discrete steps and approximating the solution at each step.

2. What is the difference between a homogeneous and non-homogeneous ODE system?

A homogeneous ODE system is one where all terms contain the dependent variable and its derivatives, whereas a non-homogeneous system has additional terms that do not contain the dependent variable or its derivatives. This means that the solution for a homogeneous system will always be a linear combination of the independent variables, while a non-homogeneous system may have a non-linear or non-constant solution.

3. Can you provide an example of a non-homogeneous ODE system?

One example of a non-homogeneous ODE system is the damped harmonic oscillator, where the equation of motion includes a term for damping force in addition to the spring force. This system can be described by the equation mx'' + bx' + kx = F(t), where m is the mass, b is the damping coefficient, k is the spring constant, and F(t) is the external force.

4. What are the limitations of numerically solving a non-homogeneous ODE system?

Numerical methods for solving ODE systems are subject to rounding errors and truncation errors, which can accumulate and affect the accuracy of the solution. Additionally, these methods may not be able to handle certain types of non-linear or stiff systems, and may require a significant amount of computation time for complex systems.

5. Are there any alternative methods for solving non-homogeneous ODE systems?

Yes, there are several alternative methods for solving non-homogeneous ODE systems, such as analytical techniques (e.g. separation of variables, variation of parameters) and numerical methods specifically designed for stiff or oscillatory systems (e.g. Gear's method, Adams-Bashforth method). However, the choice of method will depend on the specific characteristics of the system and the desired level of accuracy.

Similar threads

  • Differential Equations
Replies
6
Views
1K
Replies
3
Views
850
Replies
3
Views
1K
  • Differential Equations
Replies
2
Views
2K
  • Differential Equations
Replies
1
Views
1K
  • Differential Equations
Replies
2
Views
2K
  • Differential Equations
Replies
9
Views
2K
Replies
3
Views
2K
  • Differential Equations
Replies
4
Views
2K
Replies
2
Views
2K
Back
Top