Thread Subject: Sample time confliction

Subject: Sample time confliction

From: Hong

Date: 23 Jul, 2007 21:25:01

Message: 1 of 2

Hi,

I have a huge model here and come across following complains:

"Invalid setting for fixed-step size (0.001) in model "XXXX". All sample times in your model must be an integer multiple of the fixed-step size."

Even though I change the sample time to 0.0001, the problem still stay. My question is how can I solve it?

Thanks,
Hong

Subject: Sample time confliction

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 23 Jul, 2007 21:53:07

Message: 2 of 2

In article <f836bd$cd1$1@fred.mathworks.com>, Hong <honghaot@gmail.com> wrote:

>I have a huge model here and come across following complains:

>"Invalid setting for fixed-step size (0.001) in model "XXXX". All sample times in your model must be an integer multiple of the fixed-step size."

>Even though I change the sample time to 0.0001, the problem still stay. My question is how can I solve it?


There is no exact binary decimal representation of 0.001 or 0.0001
so it can be a bother to have your sample times be exact integral
multiples of those fractions. You can tweak the sample times
to be the closest bit representation to multiples of the
representation of 0.001 or 0.0001, with some bother about round-off
error, but then you have the question of whether the routine
that does the checking for integral multiples uses the same precise
formula or whether it has a -different- round-off error...

Sample times that are powers of 2 are easier to deal with.
For example, 0.001 is just a bit larger than 1/1024, which *is*
exactly representable, so if can use 1/1024 as your step-size instead
then you save yourself a lot of frustration.
--
   I was very young in those days, but I was also rather dim.
   -- Christopher Priest

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
simulink sample... Hong 23 Jul, 2007 17:25:04
rssFeed for this Thread

Contact us at files@mathworks.com