필터 지우기
필터 지우기

Simulation step size in simulink is very small and takes really long to run. Unable to solve it

조회 수: 14 (최근 30일)
Hello, I am trying to model the interaction between a robotic structure and a human hand. Here's a brief description of my system. All the blocks in yellow represent my robot and associated FK equations while the blocks in blue represent my human hand model and corresponding FK equations. I have a constraint in that I cannot model the dynamics directly and need to use only a second order model to approximate the behavior. Further, the robot and the Human are coupled by a large stiffness and the corresponding interaction force is recorded. It is a 1 dof robot coupled to a 1 dof human joint.
In the image below X=[f1(q),f2(q),f3(q)]^T; X_h=[f4(q_h),f5(q_h),f6(q_h)]^T; J_MM=[f7(q),f8(q),f9(q)]^T;J_h_t=[f10(q_h),f11(q_h),f12(q_h)]^T;
Now for the problem I'm having: The simulation step size is automatically chosen to be extremely small (order of e-5). all my FK and Jacobian equations are simple algebraic equations in a single variable and when i evaluate them in matlab, I am able to run 10000 evaluations (using a for loop) in 0.05s.
I am very new to simulink and do not have much experience. so any help regarding how I can solve this is very much appreciated!
HEBI Block

답변 (1개)

Sam Chak
Sam Chak 2023년 9월 20일
It's not bad for a beginner in Simulink to create a rather sophisticated model using mostly user-defined MATLAB Function blocks and feedback loops. If the Simulink model takes a long time to run, open the Model Configuration Pane: Solver and select the ode15s solver.
  댓글 수: 2
Suhas Raghavendra Kulkarni
Suhas Raghavendra Kulkarni 2023년 9월 20일
Dear Sam, Thank you very much for your response! Indeed the solution time is orders of magnitude better, however, is still slow (takes roughly 200s to simulate 3s of simulation) considering the next step for me would be to run this in (near) real time (response time <0.5s) while communicating with motors and sensors. For this, I would like to improve the model and make it more robust possibly using built-in simulink blocks and functions.
Is there any advice you can provide to me to improve the model from it's current form?
Sam Chak
Sam Chak 2023년 9월 21일
Some sophisticated systems take longer to simulate. If you identify that your system is stiff, then change the solver to ode15s.

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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by