Thread Subject: algebraic loop

Subject: algebraic loop

From: Steve

Date: 26 Jul, 2007 16:59:49

Message: 1 of 3

What are the ramifications of leaving algebraic loops in a Simulink model? Is it only slower run time?

How can I get rid of them besides re-writing my equations (which I don't think is possible, anyway)? What do people mean when they suggest using memory blocks?

Thanks!

Subject: algebraic loop

From: Steve

Date: 26 Jul, 2007 19:11:02

Message: 2 of 3

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

Subject: algebraic loop

From: Moises Diaz de Leon Martinez

Date: 27 Nov, 2007 13:59:54

Message: 3 of 3

Why to use memory blocks:

What we want to do with these is to synchronize the arrival
of the data that comes from the feedbacks of your loops and
the inputs to your blocks.

To be sure that this synchronization will be done and to
prevent the arriving of one of the values before the other,
we use memory blocks (e.g. Zero-Order Hold, or trigger-based
memory blocks) which will receive the values, store them for
a periode (simulation-step) and release them after this
periode in a simultaneous way.

      
in --- --- --- out
______|MEM|____|+/-|____|Op.|____________
       --- --- --- |
                 | --- |
                 |______|MEM|_____|
                         --- feed

OR/AND

in --- --- --- out
______|+/-|___|MEM|___|Op.|_____________
       --- --- --- |
        | |
        |_______________________|
                            feed


That might be a solution for your problem.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
simultaneous eq... Steve 26 Jul, 2007 15:15:06
algebraic loops Steve 26 Jul, 2007 15:15:06
memory blocks Steve 26 Jul, 2007 13:00:22
algebraic loop Steve 26 Jul, 2007 13:00:22
rssFeed for this Thread

Contact us at files@mathworks.com