Simulink model needs to run repeatedly with different parameters within 1 time step.

3 views (last 30 days)
Is this possible:
I have Fortran code (ew) that I would like to convert into a Simulink model. The purpose of this code is to simulate fluid flow through different types of devices in the specified configuration. I've already converted part of the code to Simulink, namely the configuration of the devices. The main function itself is relatively complicated so this is the best way I can describe part of the algorithm:
For each time step: 1) Run the Simulink model (one time step) using input A to get output A1 2) Run the Simulink model again (one time step) using input B to get output B1 3) C = some function of (A1 and B1) 4) Run the Simulink model again using C to get output C1, all the outputs of this simulation are the actual values for this time step. 5) Repeat for the next time step.
I can easily do this if this code is done with only Matlab, but I am trying to get a user friendly GUI by using Simulink for the portion of the code that determines the flow configuration of the devices.
If I want to use Simulink, it looks like I need to use Matlab and call out the sim model several times for only 1 time step. I would be using Matlab, not Simulink, for time increments/steps. Is there a better way?
Hope I am making sense.

Answers (0)

Categories

Find more on General Applications 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!