Multiple instances of referenced models in Normal mode

1 visualización (últimos 30 días)
Hi all,
I'm trying to design a simple model of a car by using Model Referencing. I have modeled a wheel, and I referenced this wheel model four times but with different parameters. I wish to simulate the entire system in Normal mode. However, the error I get is the following:
"Although multiple instances of a referenced model can simulate in Accelerator mode, only one instance of a referenced model can simulate in Normal mode at a time. Model 'VehicleDynamics' directly or indirectly references model 'WheelDynamics' more than once via Model blocks that are configured for Normal mode. One such Model block is 'VehicleDynamics/FR wheel'. To fix this problem, first run depview('VehicleDynamics', 'ModelReferenceInstance', true) or from the top model menu choose Tools > Model Dependencies > Model Dependency Viewer > Referenced Model Instances. The dependency viewer puts a red octagon on models referenced more than once in Normal mode. Change the parents of the blocks with red octagons so that at most one Normal mode instance exists per model."
So it seems that I cannot use multiple instances in the same model when using Normal mode. This is strange to me and I don't understand why. Is there some shortcut to simulate my model in Normal mode by using multiple references? Any suggestion will be greatly appreciated. Thanks,
Ubaldo
--

Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 17 de Abr. de 2012
You can still simulate your top-level model "VehicleDynamics" in Normal mode, however, just the model reference blocks that point to "WheelDynamics" (directly or indirectly) need to be configured to run in Accelerator mode. To change this, right-click on the Model block and select "Accelerator" for Simulation mode.
However, if you did intend even your referenced models (with multiple instances) to run in Normal mode, I believe that capability was added in R2010b. Are you using an older version?

Más respuestas (1)

Ubaldo Tiberi
Ubaldo Tiberi el 18 de Abr. de 2012
Dear Katustubha,
thanks for your answer. I understand the point that I must use Accelerator mode, but I don't want to use it because Simulink generates code in the working folder that put additional files that I will never open (it creates like a "slprj" foldes and several .mexw32 files that I don't want).
My model is composed by a system "VehicleDynamics" which contains two referenced models "WheelDynamics" (4 instances) and "LocalController" (4 instances). The model "WheelDynamics" include a continuous-time state, while the model "LocalController" just include some gains and switches, but it takes the wheel speed as an input signal and it generates a continuous-time output. My model "VehicleDynamics" runs in normal mode, the model "WheelDynmaicsFL" (FL stands for front-left) runs also in Normal mode, while the other three instances "WheelDynmaicsXX" (where XX is FR,RL,RR) run in Accelerator mode. The same is for the four instances of "LocalControllerXX": "LocalControllerFL" runs in Normal Mode, while the other three instances of the same model runs in Accelerator mode. Until here, everything works fine as long as I use a variable-step solver. If I use a fixed-step solver (like for example ode3 (Bogacki-Shampine)), I get this error:
"The Model block cannot inherit a continuous sample time. Output port 1 of Model block 'SingleWheelTEST/LocalCtrlFL' cannot accept 'continuous' sample time."
To get a better understanding of the system, I made a model with just one instance of "WheelDynamics" and "LocalController" that run in Normal mode. With the fixed step solver I still experience the same error, while with the variable-step solver everything goes smooth, and I cannot understand why!
My complete model will work with both continuous and discrete dynamics, that's why I would prefer to use a fixed-step solver also for continuous-time model, but, apparently, it does not work. Could you please help me?
Thanks,
Ubaldo
  4 comentarios
Kaustubha Govind
Kaustubha Govind el 18 de Abr. de 2012
Btw, did you configure all the models in question "SingleWheelTEST", "WheelDynamics" and "LocalController" to use a Fixed-Step solver? Or just tje top-level model?
Ubaldo Tiberi
Ubaldo Tiberi el 19 de Abr. de 2012
Sure! I can do that! sorry! :)

Iniciar sesión para comentar.

Categorías

Más información sobre Dependency Analysis en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by