Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Simple ODE: Linearly Damped Spring Mass System
Date: Tue, 27 Jan 2009 17:12:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 39
Message-ID: <glnf92$95p$1@fred.mathworks.com>
References: <gkjq5e$ph5$1@fred.mathworks.com> <gkjueb$1ts$1@fred.mathworks.com> <gkk08e$3dv$1@fred.mathworks.com> <glnejh$m7u$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1233076322 9401 172.30.248.37 (27 Jan 2009 17:12:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 27 Jan 2009 17:12:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1376919
Xref: news.mathworks.com comp.soft-sys.matlab:514308


> Problem: the above method does not like zero eig. values. so my second option is to  use ode45 and solve the problem numerically, but I'm not sure how to find the homogeneous solution using this numerical function? any tips will be great. 
===============================================================================================================================================================


One more thing: In one reference I found on the file exchange section of this site which deals with a similar problem, but with a forcing function F(t) such that the equation of motion will have a homogenous + a particular solution. 

M*X"+C*X'+K*X=F(t) 

 A typical call to strdynrk function is:
 m=eye(3,3); k=[2,-1,0;-1,2,-1;0,-1,2];
 c=.05*k; x0=zeros(3,1); v0=zeros(3,1);
 t=linspace(0,10,101);
 [t,x,v]=strdynrk(t,x0,v0,m,c,k,'func');

global Mi C K F n n1 n2
Mi=inv(m); C=c; K=k; F=functim;
n=size(m,1); n1=1:n; n2=n+1:2*n;
[t,z]=ode45(@sde,t,[x0(:);v0(:)]);
x=z(:,n1); v=z(:,n2);
 
%================================

function zp=sde(t,z)
% zp=sde(t,z)
global Mi C K F n n1 n2
zp=[z(n2); Mi*(feval(F,t)-C*z(n2)-K*z(n1))];

%================================

function f=func(t)
% f=func(t)
% This is an example forcing function for  
% function strdynrk in the case of three
% degrees of freedom. 
f=[-1;0;2]*sin(1.413*t);

My question then becomes, how to get the homogenous solution zh instead of zp, simply making f = [0;0;0] will not do the job, right?