Problem when two Simulink models are combined.

조회 수: 15 (최근 30일)
kamal kiki
kamal kiki 2019년 7월 18일
댓글: mayaka moses 2020년 7월 17일
Hi everyone,
I developped in MATLAB 2019a version, separately, two Simulink models.
They work perfectly when they are run separately.
The simulation using one of the models is very fast and the simulation using the other model is very slow but both simulations run perfectely during the simulation time which is the same for the two models.
Both of the models are configured to run with an Automatic solver selection of a solver of the Fixed-step type and a fixed step size set to Auto.
The problems start when I copy one of the models into the other model and try to run the obtained combined model: Even without connecting the inputs and the outputs of the two models the simulation is failing: it runs for a fraction of a second and then stops with the error:
An error occurred while running the simulation and the simulation was terminated
Caused by:
During one of the attempts to solve the problem I have used the Rate transition block to connects the inputs and the outputs of the two models but it did not solve the problem.
Please, can anyone help with this problem???
Every little hint is welcome.
Thank you very much in advance.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2019년 7월 18일
In the two separate models, can you run simulation and log the time? Take a look at the resulting fixed-step size. Do the same for the combined model. That might give a clue.
Some times a bigger-than-appropriate step size could cause the simulation unstable (causing nan). Knowing the step size for all above three scenerio, you could duplicate the error in one of the separate modles by specifying the step size. Then you can take a look at the response and figure out a way.
  댓글 수: 8
kamal kiki
kamal kiki 2019년 7월 23일
Hi Fangjun Jiang,
Okay, I will try to check all the blocks of the models.
If each model can work separately with the new setting of the sample times of all its blocks, then I will try again your plan with the function-call triggered subsystems.
I will let you know about the outcome, I just need time to check all the sample times of all the blocks in the 2 models.
Many thanks for your continuous support.
mayaka moses
mayaka moses 2020년 7월 17일
Hi, did you get hepl on this? I need your assistance.

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

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by