help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linear Solution Question


From: A S Hodel
Subject: Re: Linear Solution Question
Date: Wed, 3 Mar 2004 10:10:21 -0600

(1) You're attempting to use Euler integration (an O(h) accuracy method, 1st order taylor's series) with a huge time step. More precisely,
        du/dt = A*init
only at time 0.  The closed form solution of your ode is
      u(t) = expm(A*t)*init
which has derivative
     du/dt = A expm(A*T)*init.

(2) There's no need to use the Jordan decomposition [S,D] = eig(A) when computing the matrix exponential. In fact, it's a bad idea. See Moler and Van Loan, 1977, "Nineteen
        Dubious Ways to Compute the Matrix Exponential."

I think octave-forge has some ode integration routines that mimic MATLAB functionality.
There's also the routines lsode and lsim in octave itself.

On Wednesday, March 3, 2004, at 09:45 AM, DrakeGis wrote:

Hi,
  I'm solving a Linear ODE System, let say

  dU/dt = A * u(t)


and I have all the data in order to make it analytically,so in order to
know the solution at time t=1, I type...

t = 1;
A = [-1, 1;0,-2];
init = [0.5 ; sqrt(3)/2];
[S, D]=eig(A);
S*expm(D*t)*inv(S)*init

ans =

  0.38533
  0.11720

But If I want to "simulate" the system, I must calculate the solution at
each time... so for tiem t=1, I do

A*init

ans =

   0.36603
  -1.73205

Quite Diferent !!! Do you know what's wrong here ??

Thanks in Advance

  D.



-----------------------------------------
This email was sent using DACafeMail.
Get Your 10 MB eMail Account Now.
http://cafemail.edacafe.com



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



A. S. Hodel Dept. ECE, 200 Broun Hall, Auburn University AL 36849-5201
(334) 844-1854/fax(334) 844-1809, http://www.eng.auburn.edu/users/hodelas , address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]