Clear Filters
Clear Filters

How to simulate a model with a different timestep using a model block

2 views (last 30 days)
I'm using a model block in my model. This submodel block should run several times during the execution of the model.
Both models have a different stop time in their solver and both are discrete with a fixed timestep.
When I run the model, it starts to execute both models together while the MODEL block should run totally every timestep in the main model.
Can I imply it using some option of the model block or is it impossible in simuling??

Accepted Answer

Ryan G
Ryan G on 20 Nov 2012
Based on the description it sounds like you want a MODEL BLOCK to run faster than the main model using a fixed time step. This is not possible directly.
However, you can use a for each subsystem that will run the contents of the subsystem multiple times per time step. You may be able to wrap the entire contents of the model block in this type of subsystem to run at a faster rate.
Furthermore, you imply you want the model to run independently (different start/stop times), which is also not possible directly. You could create 2 seperate models and use UDP Send and receive blocks to communicate between the two. This would allow each model to function completely independent of eachother.

More Answers (0)

Categories

Find more on Multicore Processor Targets in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!