DSPRelated.com
Forums

build X(t)=Y(t)-X(t-1) using simulink!!

Started by Abdul Fattah Batran May 4, 2004
Hi all,
How to build this equation using simulink?
X(t)=Y(t)-X(t-1)
Thanks a lot.
Yours,

Abatran




Hi Abdul,
 
    If yours is a Continuous System then use the Transport Delay Block for the X(t-1) part and if it is Discrete then use the Unit Delay block. Assuming Y(t) to be the output, just feed the input X(t) to a Sum block. Also feed the same input in parallel to the Delay block and feed its output to the second input of the summer. Your equation is ready. You may give any type of continuous source as input X(t) and see the output Y(t) on a Scope.
 
    If X(t) is the output, Delay block will be in the feedback path.See the clipping below for continuous system..
 
    Hope this solves your problem.
 
 
-Snehamoy
----- Original Message -----
From: Abdul Fattah Batran
To: m...@yahoogroups.com
Sent: Tuesday, May 04, 2004 5:58 PM
Subject: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!

Hi all,
How to build this equation using simulink?
X(t)=Y(t)-X(t-1)
Thanks a lot.
Yours,

Abatran


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/matlab

More DSP-Related Groups: http://www.dsprelated.com/groups.php3




Type: image/png

Hi,
 
    I think now the problem is clear. To avoid this problem of algebraic loop you can do a very simple trick. Write your S-Function in Simulink using the S-Function builder. It is pretty simple to write a S-Function with the builder. Next don't use Direct Feedthrough in the function. Instead in the mdlUpdate function of the S-Function, read the input port and set the data for the output port. In this way you are overcoming the problem of not having direct feedthrough. This also solves the race-around condition prevailing as of now.
 
    Hope this should help you out.
 
-Snehamoy
----- Original Message -----
From: Abdul Fattah Batran
To: m...@yahoogroups.com
Sent: Friday, May 07, 2004 9:24 PM
Subject: FW: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!

Sorry friends,
My question is as follows:

If I want to build the following equation what shall I do?
X(ti)=Y(ti)-X(t(i-1))
X depends on it's previous value in the previous iteration.

Designing it with simulink gives a warring because it's an algebraic
loop, where the algebraic loop occurs when an input port with direct
feed through is driven by the output of the same block, either directly,
or by a feedback path through other blocks with direct feedthrough.
Simulink when dealing with algebraic loop, guesses the previous value
using numerical method, which gives inaccurate result in my model.
How to avoid this algebraic loop?
Could you please guide me to design the same equation without guessing
the previous value by simulink, I need the present value to be depend on
the previous iteration (at time t-h, where h is the time stip)
Thanks a lot.

Yours truly,

abatran  _____ 

From: Snehamoy Banerjee [mailto:s...@yahoo.com]
Sent: Thursday, May 06, 2004 6:14 PM
To: Abdul Fattah Batran
Subject: Re: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!
Hi,
    Could you be more explicit about your equation. Please explain the
terms and the equation.
-Snehamoy

      ----- Original Message -----

      From: Abdul Fattah Batran <mailto:a...@birzeit.edu> 

      To: Snehamoy Banerjee <mailto:s...@yahoo.com>  ;
m...@yahoogroups.com

      Sent: Thursday, May 06, 2004 2:37 PM

      Subject: RE: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!

     

      Hi,

      How to build this:

     

      X(ti)=Y(ti)-X(t(i-1))

     

      I think using delay block here is not good.

     

      thanks

     
  _____       From: Snehamoy Banerjee [mailto:s...@yahoo.com]
      Sent: Tuesday, May 04, 2004 6:30 PM
      To: m...@yahoogroups.com; Abdul Fattah Batran
      Subject: Re: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!

     

      Hi Abdul,

     

          If yours is a Continuous System then use the Transport Delay
Block for the X(t-1) part and if it is Discrete then use the Unit Delay
block. Assuming Y(t) to be the output, just feed the input X(t) to a Sum
block. Also feed the same input in parallel to the Delay block and feed
its output to the second input of the summer. Your equation is ready.
You may give any type of continuous source as input X(t) and see the
output Y(t) on a Scope.

     

          If X(t) is the output, Delay block will be in the feedback
path.See the clipping below for continuous system..

     

          Hope this solves your problem.

     

     

     

      -Snehamoy

            ----- Original Message -----

            From: Abdul Fattah Batran <mailto:a...@birzeit.edu> 

            To: m...@yahoogroups.com

            Sent: Tuesday, May 04, 2004 5:58 PM

            Subject: [matlab] build X(t)=Y(t)-X(t-1) using
simulink!!

           

            Hi all,
           
           
           
            How to build this equation using simulink?
           
           
           
            X(t)=Y(t)-X(t-1)
           
           
           
            Thanks a lot.
           
           
           
            Yours,
           
            Abatran
           
           
           
           
           
            _____________________________________
            Note: If you do a simple "reply" with your email client,
only the author of this message will receive your answer.  You need to
do a "reply all" if you want your answer to be distributed to the entire
group.
           
            _____________________________________
            About this discussion group:
           
            To Join:  m...@yahoogroups.com
           
            To Post:  m...@yahoogroups.com
           
            To Leave: m...@yahoogroups.com
           
            Archives: http://www.yahoogroups.com/group/matlab
           
            More DSP-Related Groups:
http://www.dsprelated.com/groups.php3

            <hr size=2 widthP0 style='width:375.0pt' alignter            > .

           

     
  _____      
makeover>

  _____ ermakeover


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/matlab

More DSP-Related Groups: http://www.dsprelated.com/groups.php3



Hi,
 
    One point I forgot to mention in my previous mail. You can avoid this problem by using the IC block which sets an initial condition. That is it gives an output for the looped block at t=0 and this will avoid the guessing problem.
 
    Cheers,
 
-Snehamoy
----- Original Message -----
From: Abdul Fattah Batran
To: m...@yahoogroups.com
Sent: Friday, May 07, 2004 9:24 PM
Subject: FW: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!

Sorry friends,
My question is as follows:

If I want to build the following equation what shall I do?
X(ti)=Y(ti)-X(t(i-1))
X depends on it's previous value in the previous iteration.

Designing it with simulink gives a warring because it's an algebraic
loop, where the algebraic loop occurs when an input port with direct
feed through is driven by the output of the same block, either directly,
or by a feedback path through other blocks with direct feedthrough.
Simulink when dealing with algebraic loop, guesses the previous value
using numerical method, which gives inaccurate result in my model.
How to avoid this algebraic loop?
Could you please guide me to design the same equation without guessing
the previous value by simulink, I need the present value to be depend on
the previous iteration (at time t-h, where h is the time stip)
Thanks a lot.

Yours truly,

abatran  _____ 

From: Snehamoy Banerjee [mailto:s...@yahoo.com]
Sent: Thursday, May 06, 2004 6:14 PM
To: Abdul Fattah Batran
Subject: Re: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!
Hi,
    Could you be more explicit about your equation. Please explain the
terms and the equation.
-Snehamoy

      ----- Original Message -----

      From: Abdul Fattah Batran <mailto:a...@birzeit.edu> 

      To: Snehamoy Banerjee <mailto:s...@yahoo.com>  ;
m...@yahoogroups.com

      Sent: Thursday, May 06, 2004 2:37 PM

      Subject: RE: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!

     

      Hi,

      How to build this:

     

      X(ti)=Y(ti)-X(t(i-1))

     

      I think using delay block here is not good.

     

      thanks

     
  _____       From: Snehamoy Banerjee [mailto:s...@yahoo.com]
      Sent: Tuesday, May 04, 2004 6:30 PM
      To: m...@yahoogroups.com; Abdul Fattah Batran
      Subject: Re: [matlab] build X(t)=Y(t)-X(t-1) using simulink!!

     

      Hi Abdul,

     

          If yours is a Continuous System then use the Transport Delay
Block for the X(t-1) part and if it is Discrete then use the Unit Delay
block. Assuming Y(t) to be the output, just feed the input X(t) to a Sum
block. Also feed the same input in parallel to the Delay block and feed
its output to the second input of the summer. Your equation is ready.
You may give any type of continuous source as input X(t) and see the
output Y(t) on a Scope.

     

          If X(t) is the output, Delay block will be in the feedback
path.See the clipping below for continuous system..

     

          Hope this solves your problem.

     

     

     

      -Snehamoy

            ----- Original Message -----

            From: Abdul Fattah Batran <mailto:a...@birzeit.edu> 

            To: m...@yahoogroups.com

            Sent: Tuesday, May 04, 2004 5:58 PM

            Subject: [matlab] build X(t)=Y(t)-X(t-1) using
simulink!!

           

            Hi all,
           
           
           
            How to build this equation using simulink?
           
           
           
            X(t)=Y(t)-X(t-1)
           
           
           
            Thanks a lot.
           
           
           
            Yours,
           
            Abatran
           
           
           
           
           
            _____________________________________
            Note: If you do a simple "reply" with your email client,
only the author of this message will receive your answer.  You need to
do a "reply all" if you want your answer to be distributed to the entire
group.
           
            _____________________________________
            About this discussion group:
           
            To Join:  m...@yahoogroups.com
           
            To Post:  m...@yahoogroups.com
           
            To Leave: m...@yahoogroups.com
           
            Archives: http://www.yahoogroups.com/group/matlab
           
            More DSP-Related Groups:
http://www.dsprelated.com/groups.php3

            <hr size=2 widthP0 style='width:375.0pt' alignter            > .

           

     
  _____      
makeover>

  _____ ermakeover


_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:  m...@yahoogroups.com

To Post:  m...@yahoogroups.com

To Leave: m...@yahoogroups.com

Archives: http://www.yahoogroups.com/group/matlab

More DSP-Related Groups: http://www.dsprelated.com/groups.php3