Hi, im having trouble with my animation in my simulink. I am plotting a reversing dolly with a trailer. The plot is in my animation function and as one of the inputs is a clock. But my problem is that the time jumps back in time. I have the clock time as a tilte in the plot: hTitle=title(sprintf('Time = %0.3g',t1(1)));. For example it will go from displayinh 0.665 sec to 0.435. I scoped the clock and it seems to be functioning correctly. It also seems to happen at a certain point in my simulation, especially when the dolly is turning. I was wondering if someone has an idea of what it could be that makes this problem.
Thanks in forehand, Soleil

 채택된 답변

Steven Lord
Steven Lord 2021년 3월 24일

0 개 추천

My guess is that you're encountering the situation described at the end of page 7 of the chapter on ODEs in Cleve's Numerical Computing with MATLAB book.
"If this error is less than the specified tolerance, then the step is successful and is accepted. If not, the step is a failure and is rejected. In either case, the error estimate is used to compute the step size h for the next step."
If you're walking down a sidewalk and realize your next step will put you squarely in the middle of a puddle, you may take a smaller next step so the one after that can put you safely across the puddle. Unless you're a little kid, in which case your next step becomes a jump into the center of the puddle with both feet :)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Clocks and Timers에 대해 자세히 알아보기

질문:

2021년 3월 24일

답변:

2021년 3월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by