Thread Subject: Time extraction

Subject: Time extraction

From: Prashant Sandhi

Date: 25 Feb, 2010 10:55:21

Message: 1 of 2

I have two variables U1 and U2. At some point these two variable difference becomes zero. I run my simulation 'under' 'inf' condition in simulink. I want to know how I can extract the time when the difference was zero while the simulation still continues. As I need this time to be substituted in my calculation.

lets say for example at time 20 sec's the U1-U2=0 but my simulation still continues and passes 20,21,22,23,,,,,......and so on but I need that 20 sec's and let the simulation continue. I have to keep in mind that U1 and U2 are variables so at any time the difference between them will get 'zero'.

Any suggestion will be apprciciated.

    Thanking you,

Sandhi

Subject: Time extraction

From: James Allison

Date: 25 Feb, 2010 16:24:07

Message: 2 of 2

Using a compare to zero block will help you test when u1-u2=0, and you
can use the clock block to access the time.

-James

Prashant Sandhi wrote:
> I have two variables U1 and U2. At some point these two variable
> difference becomes zero. I run my simulation 'under' 'inf' condition in
> simulink. I want to know how I can extract the time when the difference
> was zero while the simulation still continues. As I need this time to be
> substituted in my calculation.
>
> lets say for example at time 20 sec's the U1-U2=0 but my simulation
> still continues and passes 20,21,22,23,,,,,......and so on but I need
> that 20 sec's and let the simulation continue. I have to keep in mind
> that U1 and U2 are variables so at any time the difference between them
> will get 'zero'.
>
> Any suggestion will be apprciciated.
>
> Thanking you,
>
> Sandhi

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
time extraction... Prashant Sandhi 25 Feb, 2010 05:59:08
rssFeed for this Thread

Contact us at files@mathworks.com