How are math operations of constants in simulink models performed?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michael Knörzer
le 2 Mai 2019
Commenté : Michael Knörzer
le 3 Mai 2019
Are the results calculated at every simulation step or are they calculated only once at the beginning of the simulation?
example:
If I have two constants a and b. In Simulink I call them through constant blocks and add them using an add block. Does the solver calculate this sum at each calculation step or does it calculate the sum only once?
0 commentaires
Réponse acceptée
Thomas Ayres
le 2 Mai 2019
Hi Michael,
It depends how you have configured the sample time for your Simulink constant blocks and maths blocks. If they have a sample time of inf then they will only be calculated once. If not they will be calcuated at the sample time assigned.
Regards
Tom
Plus de réponses (1)
Raj
le 2 Mai 2019
The computation is done at each simulation step time. So if you are adding two constant blocks, from t=start of simulation to t=end of simulation, Simulink computes the sum at each sampling time step.
4 commentaires
Thomas Ayres
le 2 Mai 2019
In this case you are correct, the answer is not constant and is computed throughout, but this isn't the case asked by Michael. In your example you don't have 2 constants being added. The sample time of the signal coming from the switch will be driven by your signal builder block creating a varying signal. If you had Michaels example described above you could configure it to computer once or multiple times.
Voir également
Catégories
En savoir plus sur General Applications dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!