Improving Simulation Speed in Simulink Using C language (mexw64 File) for DC/DC Converters
I have a question regarding speeding up the simulation using Simulink and a compiled C language mexw64 file. Suppose I have 8 DC/DC converters, each controlled by a dual-loop control strategy, and the control of each converter is independent. How can I use the mexw64 file to achieve the fastest simulation speed? I am mainly comparing the following two scenarios:
Input the data of all 8 converters into a single s-function module containing the mexw64 file. In C language, set 8 groups of control parameters with the same structure, and use one mexw64 file to output the duty cycles for all 8 converters, as shown in the figure below.
Fig. 1 simulink and C code
Use 8 separate s-function modules, each containing the same mexw64 file, with each s-function module calculating the duty cycle of its respective converter, as shown in the figure below.
Fig. 2
Which scenario will result in faster simulation speed? Thank you for your assistance.I have a question regarding speeding up the simulation using Simulink and a compiled C language mexw64 file. Suppose I have 8 DC/DC converters, each controlled by a dual-loop control strategy, and the control of each converter is independent. How can I use the mexw64 file to achieve the fastest simulation speed? I am mainly comparing the following two scenarios:
Input the data of all 8 converters into a single s-function module containing the mexw64 file. In C language, set 8 groups of control parameters with the same structure, and use one mexw64 file to output the duty cycles for all 8 converters, as shown in the figure below.
Fig. 1 simulink and C code
Use 8 separate s-function modules, each containing the same mexw64 file, with each s-function module calculating the duty cycle of its respective converter, as shown in the figure below.
Fig. 2
Which scenario will result in faster simulation speed? Thank you for your assistance. I have a question regarding speeding up the simulation using Simulink and a compiled C language mexw64 file. Suppose I have 8 DC/DC converters, each controlled by a dual-loop control strategy, and the control of each converter is independent. How can I use the mexw64 file to achieve the fastest simulation speed? I am mainly comparing the following two scenarios:
Input the data of all 8 converters into a single s-function module containing the mexw64 file. In C language, set 8 groups of control parameters with the same structure, and use one mexw64 file to output the duty cycles for all 8 converters, as shown in the figure below.
Fig. 1 simulink and C code
Use 8 separate s-function modules, each containing the same mexw64 file, with each s-function module calculating the duty cycle of its respective converter, as shown in the figure below.
Fig. 2
Which scenario will result in faster simulation speed? Thank you for your assistance. simulink, s-function, c code MATLAB Answers — New Questions