Manual Switch management for Simscape simulation
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm using Manual Switches in a Simscape simulation with Simulink Desktop Real-Time to change a valve states (close <-> open). In doing this I'm encountering to different inconvenient:
- I'm feeding a derivative state block, the valve, with a non-continuous signal generated by the manual switch
- Every time I stop the simulation, I need to reset the state of the manual switches since they remain in the last position
First issue: since the manual switch will be replaced by signal coming from PLC that is non continuous as well, I need something to put in the middle between the valve and the non-continuous signal to manage this discontinuity (if it exists).
Second issue: I thought to use the "setparam" function but there are a lot of manual switches, so I want to ask if there is a faster way.
0 Kommentare
Antworten (1)
Jan Houska
am 29 Jul. 2023
Hi,
for the first issue, if the discontinuity is the problem, a simple first-order delay should do the trick. However, feeding discontinuities into the input of derivatives may also mean that you have oversimplified your model and there's some dynamic behavior that you may have neglected. This is difficult to say without actually seeing the model.
For the second issue, an alternative way would be just to close the model without saving it, then re-open it. This probably won't be faster than set_param but can be simpler. However, I'd probably still prefer finding the manual switches by find_system and then using set_param to set their values.
Good Luck, Jan
0 Kommentare
Siehe auch
Kategorien
Mehr zu Target Computer Setup finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!