![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/609510/image.png)
How can I get the instantaneous step size value in variable step solver at a simulink model?
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everyone,
This is an urgent stuation. I got a proble to get the value of instantaneous step size value in variable step solver. In my simscape model there is also a runge kutta solver function that I wrote and I need a h value which is a h=step_value/10. I dont want to use fixed step solver. That is why I need to know step value for each time step. I would be appreciated if you help me.
0 Kommentare
Antworten (1)
Uday Pradhan
am 6 Mai 2021
Hi, you can use the "Clock" block in Simulink to get the current simulation time and the "memory" block to store this value for each step. In each step, subtract the output of "Memory" block (i.e. previous time step) from the current output of "Clock" to get the current step size. Here is a sketch of the workflow:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/609510/image.png)
I hope this helps!
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!