- Solver Configuration: Differences in solver configurations between Dymola and Simulink can lead to discrepancies. Ensure that the solver used in Simulink closely matches the characteristics of the CVODE solver used in Dymola in terms of accuracy and numerical methods.
- Communication Step Size: Although you've experimented with this, the choice of communication step size is crucial for co-simulation FMUs. A smaller step size generally leads to higher accuracy at the cost of longer simulation times. However, too small a step size can introduce numerical instability. Finding an optimal step size may require further experimentation.
- Initial Conditions and Parameters: Ensure that all initial conditions and parameters in the Simulink model exactly match those in the Dymola source model. Even slight differences can lead to divergences, especially over long simulation periods.
- State Events and Discontinuities: If your model involves state events or discontinuities (e.g., switches, relays), ensure that these are accurately captured and handled in Simulink. Discrepancies in handling these events can lead to significant deviations in results.
- Advanced Solver Settings: Explore advanced solver settings in Simulink, such as tolerance levels and maximum step sizes. Adjusting these settings can sometimes mitigate discrepancies in simulation results.
- For understanding solver configurations in Simulink, refer to the documentation on choosing a solver: https://www.mathworks.com/help/simulink/ug/choosing-a-solver.html.
- For details on importing and simulating FMUs in Simulink, see the documentation on FMU import: https://www.mathworks.com/help/simulink/slref/import-fmu.html.