Simscape Controlled Voltage Source not Behaving Properly (R2023b)

14 views (last 30 days)
Hey all,
for some time I'm facing an errating behavior with controlled voltage sources in Simscape. Basically, they sometimes don't act like they are supposed to, without any error or warning whatsoever.
As you can see in the example below, the input changes from 10V to 0V. As the source code of the voltage source only says "v == vT", the output should follow immediately. However, it doesn't, it takes many more sampling steps until it changes.
This behavior is hard to reproduce, it tends to only appear in larger models and sometimes suddenly disappears when changing random things in the model that should have no impact on these components. This makes it extremely frustrating. I already noticed it in previous releases and not just R2023b.
If anyone has an idea how to solve this issue, I'd be very grateful. Below you also find my solver settings, if that helps.
Thank you!

Answers (1)

MULI
MULI on 29 Mar 2024
Edited: MULI on 3 Apr 2024 at 8:50
Hi Michael,
I understand that you are observing erratic behaviour with controlled voltage sources in Simscape could be attributed to several factors. Here are some suggestions that might help you in resolving this issue:
  • Since you are using a variable step solvers sometimes it struggles with the simulation of electrical circuits, especially when there are rapid changes or nonlinear components involved. So you can try switching to a fixed-step solver temporarily to see if the behavior improves.
  • The tolerance settings you are using are quite tight, which is generally good for accuracy but can sometimes lead to unexpected behavior if the solver struggles to meet these tolerances in complex models. So try relaxing the tolerance settings slightly and observe the change.
  • Rapid changes in voltage can sometimes be challenging for solvers to handle, especially if there are discontinuities involved. Review the model for any elements that might introduce discontinuities and see if there are smoother ways to model those transitions.
  • As the issue is with complex model you can try incrementally building up your model from a known good state until the issue reappears. This can help identify the specific addition that leads to the erratic behavior.
Hope these suggestions will help you in resolving the query!

Categories

Find more on Electrical Sensors in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!