필터 지우기
필터 지우기

how can i define specific sample time points?

조회 수: 2 (최근 30일)
Timo
Timo 2016년 7월 1일
댓글: Timo 2016년 7월 6일
i want to sample a step in simulink. But i want to define at which point my step is sampled how can i define a vector with the timepoints?
e.g. my simulation runs 1sec.
Then i want to sample the simulation e.g. at [0.01, 0.02, 0.03, 0.05, 0.09, 0.15, 0.3 .... ]
is this possible and how?
edit: is it possible to set the Solver to inherited (-1)
And i put a triggerblock into my simulinkmodel to specify when my model samples? Could this be a solution? If yes how can i realise it?
  댓글 수: 4
Timo
Timo 2016년 7월 2일
편집: Timo 2016년 7월 2일
mh. I need to know where i can setup the discrete sample values in matlab/simulink.
i can configure the following 2 screens. But i dont know how i can define a vector with all my timings in which my simulink model samples.
Timo
Timo 2016년 7월 4일
Another idea:
is it possible to set the Solver to inherited (-1)
And i put a triggerblock into my simulinkmodel to specify when my model samples? Could this be a solution? If yes how can i realise it?

댓글을 달려면 로그인하십시오.

채택된 답변

Swarooph
Swarooph 2016년 7월 5일
There is a lot of information required to be able to help choose a solver (Does your system have continuous states? Does it have discontinuities like switches etc?). So, I am going to suggest the following to see if this might work:
In the second screen that you are showing (called the Solver pane), set the following properties:
Type: Variable-Step
Solver: auto (if you have that option) or ode45
Now navigate to the Data Import/Export pane (choose on the left side) and set the following properties on the right side:
Output options: Produce specified output only
Output times: Your full time vector e.g. [0.01, 0.02, 0.03, 0.05, 0.09, 0.15, 0.3 .... ]
NOTE: These options mean output is produced ONLY for the specified time vector. Simulink would have no control over the accuracy of your model. IF you want Simulink to assure accuracy within the specified tolerance, set the following property instead:
Output options: Produce additional output
Output times: Your full time vector e.g. [0.01, 0.02, 0.03, 0.05, 0.09, 0.15, 0.3 .... ]
This means, Simulink will control the solver step size as to when the system needs to be solved to get the best response. In addition to this, we can add your time points as well to FORCE the solver to produce additional outputs.
To get more information about this property, refer to the documentation here .
  댓글 수: 1
Timo
Timo 2016년 7월 6일
Hello Swarooph,
thanks a lot!
This helped me so much!!!!! Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by