2008年11月19日星期三

Get An Exact Result By Simulink Without Shorten The Step Size

If we want to get a exact result from simulink, we have to shorten the step size of simulation. But if it needs a very long time?
Sometimes, in a very long time simulaion, there is only a very short period when we have to shorten the step size. And at the other periods, we needn't to simulated in a very low speed, for only a litter time are important which we have to focus on. For example, only a little time when the moto works, which is so called the important period.In this situation, we can change the step size dynamically. Here is a very simple way to get it:
When the moto are working, we can make a Enable Subsystem to work which include a Pulse Generator block. If you want a step size of 1s at that time, you should make the period of the Pulse Generator to be double of 1s, and then you can make sure that the step size have changed to 1s even if it was 100s before!The blocks in the Enable Subsystem is shown below:

没有评论: