i want to add switch blocks that switches my input

1 vue (au cours des 30 derniers jours)
Adi Taib
Adi Taib le 5 Juin 2023
Réponse apportée : Jon le 6 Juin 2023
hi,
i tried to add an switch block to my model to switch the input to the divider betwenn the look up table to a constat of 0.
im putting the conditions properly but everytime i running the simulation its stops me when it reaches the condition i gave him and i cannot understand why or how i can make that switching.
please help me :(
  2 commentaires
Saurabh
Saurabh le 6 Juin 2023
By Looking at the Image I can figure out that if voltageBattery value is greather than or equal to 470, then it will take the Constant value otherwise 0.
Am I right?
And Can You Provide a little bit more description about the error you are getting?
Adi Taib
Adi Taib le 6 Juin 2023
youre right,
i want to make a switch with this condition that when voltageBattery value is greater then or equal to 470 that it will swithc the input of the Lookup table to the constant of 0.
the error that it show to me is:

Connectez-vous pour commenter.

Réponses (1)

Jon
Jon le 6 Juin 2023
The problem you have is not with the switch, but with the "algebraic loop" that is formed when the switch changes state.
Typically you will find a loop of blocks all with "direct feedthrough".
First check if you really intended to create an algebraic loop, or whether you are missing for example some integration or time delay block that would have broken the loop. If not, a typical work around is to add a small delay somewhere in the loop, but you should check that this would still give you physically meaningful results before you resort to this approach.

Catégories

En savoir plus sur General Applications dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by