Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A Numerically calculating non-homogeneous ODE system

  1. Jul 13, 2016 #1
    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?
     
  2. jcsd
  3. Jul 14, 2016 #2

    Twigg

    User Avatar
    Gold Member

    What are the equations?
     
  4. Jul 14, 2016 #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
     
  5. Jul 15, 2016 #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.
     
  6. Jul 18, 2016 #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?
     
  7. Jul 22, 2016 #6

    Twigg

    User Avatar
    Gold Member

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Numerically calculating non-homogeneous ODE system
Loading...