Path: news.mathworks.com!not-for-mail
From: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: algebraic loop
Date: Thu, 26 Jul 2007 19:11:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <f8ark6$4pi$1@fred.mathworks.com>
References: <f8aju5$6tr$1@fred.mathworks.com>
Reply-To: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185477062 4914 172.30.248.35 (26 Jul 2007 19:11:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 26 Jul 2007 19:11:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1034320
Xref: news.mathworks.com comp.soft-sys.matlab:421268



To help clarify my problem, I have pasted a much-simplified but similar code below.  The problem here is that T1 and T2 need to be solved simultaneously.  So, I just looped both back as inputs, thus giving me the algebraic loops.  Any way around this?  Thanks.

------------------------------------------------

function out=test_noloop(u)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%RESISTANCES AND CAPACITANCES
R1=10;
R2=20;
R3=30;
R4=40;

C=5.5;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%INPUTS
To=u(1);
Ti=u(2);
T1=u(3);
T2=u(4);
T=u(5);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%FUNCTIONS
T1=(To/R1+2*T/R2+T2/R3)/(1/R1+2/R2+1/R3);
Tdot=(2*(T1-T)/R2+2*(T2-T)/R2)/C;
T2=(2*T/R2+T1/R3+Ti/R4)/(2/R2+1/R3+1/R4);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%OUTPUTS
out(1)=T1;
out(2)=T2;
out(3)=Tdot;

%END