|
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
|