Thread Subject: Simulation Time

Subject: Simulation Time

From: Joseph Ho

Date: 23 Oct, 2008 08:12:01

Message: 1 of 6

Hi there, I have some simulink problem. Lets say I have a transfer function like this:

az^-1 + bz^-2 +cz^-3

The initial value of a,b,c are 0.1 0.2 0.3. I would like to change the value to 0.4 0.1 -0.5 at the nth iteration step. How to do I do it? How to I code the simulation time in simulink so that I can write "if the time > 70, a = 0.4, b =0.1, c= -0.5? Thanks.

Subject: Simulation Time

From: checker

Date: 23 Oct, 2008 21:03:52

Message: 2 of 6

On Oct 23, 1:12=A0am, "Joseph Ho" <hoy...@yahoo.com> wrote:
> Hi there, I have some simulink problem. Lets say I have a transfer functi=
on like this:
>
> az^-1 + bz^-2 +cz^-3
>
> The initial value of a,b,c are 0.1 0.2 0.3. I would like to change the va=
lue to 0.4 0.1 -0.5 at the nth iteration step. How to do I do it? How to I =
code the simulation time in simulink so that I can write "if the time > 70,=
 a =3D 0.4, b =3D0.1, c=3D -0.5? Thanks.

Decompose the transfer function to a block diagram. Use multipliers
wherever the constants are required. Use the sim time block and
relational operator to drive a switch with the 2 different constant
sets.

-Chris

Subject: Simulation Time

From: Joseph Ho

Date: 24 Oct, 2008 04:22:02

Message: 3 of 6

Hey Chris.. is such there such a block called the sim time block? I can't find it in simulink though... Can you help?

Joseph

Subject: Simulation Time

From: Bart Roossien

Date: 24 Oct, 2008 06:38:04

Message: 4 of 6

> Hey Chris.. is such there such a block called the sim time block? I can't find it in simulink though... Can you help?

Sim time is given by the block Simulink/Sources/Clock

Subject: Simulation Time

From: Joseph Ho

Date: 24 Oct, 2008 12:06:02

Message: 5 of 6

But how do I use the clock? Even with the clock, I cannot use it unless I can code it like:

if clocktime < x
.....

else
...

end

How do I do this? Is there a way that the clock time can be coded as a variable that I can use throughout the entire simulink model?


"Bart Roossien" <myLastName@myCompany.nl> wrote in message <gdrqgc$1fd$1@fred.mathworks.com>...
> > Hey Chris.. is such there such a block called the sim time block? I can't find it in simulink though... Can you help?
>
> Sim time is given by the block Simulink/Sources/Clock

Subject: Simulation Time

From: Steven Lord

Date: 24 Oct, 2008 13:49:33

Message: 6 of 6


"Joseph Ho" <hoyoku@yahoo.com> wrote in message
news:gdsdna$jco$1@fred.mathworks.com...
> But how do I use the clock? Even with the clock, I cannot use it unless I
> can code it like:
>
> if clocktime < x
> .....
>
> else
> ...
>
> end
>
> How do I do this? Is there a way that the clock time can be coded as a
> variable that I can use throughout the entire simulink model?

You might find some of the Logic and Bit Operations blocks useful, like
Compare To Constant, Relational Operator, or Interval Test:

http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/f4-4889.html#f4-5692

You can use the output of those blocks with an If block from Ports &
Subsystems or a Switch from Signal Routing.

--
Steve Lord
slord@mathworks.com

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
signal processing Joseph Ho 23 Oct, 2008 04:15:05
rssFeed for this Thread

Contact us at files@mathworks.com