Matlab's sim command giving different resultas than Simulink

2 vues (au cours des 30 derniers jours)
Dimosthenis Michaloudis
Dimosthenis Michaloudis le 2 Oct 2023
Commenté : Yash le 22 Nov 2023
Hello,
I am using a Matlab code in order to simulate a Simulink power system. To specify, the code runs the first data (each data originates from a table and represents a neighboorhood's load needs), simulates, loops back, refreshes the data (new row in table), simulates, and so on.
There are also some variables that sum up the load needs from the data, and some variables that sum up the power system's actual generation. For example the first will show that a load of 100 kW is requested. The actual generation might be 100,3 kW.
When I run the system straight from Simulink, it runs perfectly. The results are optimal, as well as the scopes.
When I run the system through Matlab though, some vast differences come into play. The variables are way off, for example the total load requested is 100.000 kW, but the actual generation is 100.000.000 kW. The scopes are somewhat closer, but I believe that they can be fixed with Operating Set Points.
Any ideas on how to fix my problem? Essentially it's the same system, but the results are different.
  1 commentaire
Yash
Yash le 22 Nov 2023
Hi Dimosthenis,
It is not possible to detemine the exact reason for the issue that you are facing without actually analysing the model. There might be some issues related to the initial conditions or the model setup. Kindly share the .slx file for better resolution.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by