vectorization

grivet grivet at cnrs-orleans.fr
Mon Oct 3 17:12:27 CEST 2011


Hello,
I wish to solve a system of linear differential equations of first order
     x' = Rx
with R a symmetric matrix of coefficients. The formal solution is simple:
     x = S*exp(Kt)*inv(S)*x(0)
where S is the matrix that diagonalizes R:
     K = inv(S)*R*S
With Scilab, I would do, for instance,  t = 0:0.01:10, but then, what is 
the best way to
compute exp(Kt)  and the above matrix product ?
Up to now, I have worked with  2*2 matrices R and K, so that I compute 
exp[K(1,1)*t(i)], exp[K(2,2)*t(i) and x(t(i)) within
a loop, but that doesnot seem very efficient.
Thanks in advance
JP Grivet





More information about the users mailing list